Hi I have a problem in Code Challenge: Loop exercise 3:
def add_greetings(names):
greet_lst = []
for name in names:
greet_lst = "Hello, " + name
#greet_lst.append("Hello, " + name)
return greet_lst
#Uncomment the line below when your function is done
print(add_greetings(["Owen", "Max", "Sophie"]))
Why is the append method working - so that all names are printed with Hello but not the other way --> here only the last name is printed?
Can you explain me why?