def myarray(num_list):
for item in num_list:
return item
def myarray(num_list):
for item in num_list:
print (item)
When I run myarray([2,4,6]) the first returns only 2 while the second prints all the items:
2
4
6
Why? What's the difference?