I gett an unwanted "none" as an output while using fuction in for lopp
people = ["oscar", "carl", "jenny"]
print(name + " and")
for x in people:
> oscar and
> carl and
> jenny and
why does this happen, where does "none" come from?
okej so i have solved this but will leave the post up if anyone is curious.
The error occurs because print() is used twice. If we look att the first loop then x will be "oscar". What im telling the program is:
print(add_and(x)) --> print(print(oscar + " and")).
It's not necessary to use print() twice. But I dont really undersand why " oscar and" and "none" is the output.