For some reason the make_great function is not affecting the output of the show_magicians function. I'm trying to alter the list but it's not working.

# the make_great function is not affecting the show_magicians function as 
# intended

magicians = ['david', 'caroline', 'benjamin', 'alex', 'steve']

def make_great(magicians_to_change):
    for magician in magicians_to_change:
        magician = "the Great " + magician

def show_magicians(magicians_to_print):
    for magician in magicians_to_print:
        print(magician.title())
    print("\n")

show_magicians(magicians)
make_great(magicians)
show_magicians(magicians)

I'm aware this is a stupid newb question, so thanks in advance for dealing with it.

Read your code, Now look at what you did there. You never altered the magicians list (or array.)

You use for magician in magicians_to_change: so you get a copy back of the element and not the array item itself. Then you change your copy then never use it.

Next time just use the old school index method. Example. You fix if borked.

for index, item in enumerate(magicians):
    magicians[index] = "Bullwinkle and " magicians[index]
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.