2018-04-18

print()

#8-10. Great Magicians:

def show_magicians(names):

    """Print the name of each magician in the list."""

    for name in names:

        print(name.title())

def make_great(names):

    """adding the phrase the Great to each magician’s name."""

    for name in names:  # 这样并不能改变magician中的值

        name = "The Great " + name

magicians = ['harry houdini', 'david blaine', 'teller']

show_magicians(magicians)

make_great(magicians)

你可能感兴趣的:(2018-04-18)