O'Reilly logo
  • Longxiang Lyu thinks this is interesting:

8-11. Unchanged Magicians:

From

Cover of Python Crash Course

Note

magicians = ['bob dylan', 'zemin jiang', 'british queen']

def show_magicians(names):
"""print magician names"""
print("\nthe magicians are:")
for name in names:
print name.title()

show_magicians(magicians)

def make_great(names):
for i, name in enumerate(names):
names[i] = 'The Great ' + name
return names

magicians_copy = make_great(magicians[:])
show_magicians(magicians)
show_magicians(magicians_copy)