Difference between append and extend in Python

append() adds an item at the end.
extend() adds the contents of an iterable at the end.

def main():
    dishes = ['spam', 'eggs']
    dishes.append('ham')
    print dishes
    dishes.extend(['spam', 'spam', 'spam'])
    print dishes

This prints:

['spam', 'eggs', 'ham']
['spam', 'eggs', 'ham', 'spam', 'spam', 'spam']