For One and All


This is my code:

my_list = [1,9,3,8,5,7]

for number in my_list:
return 2 * number

Why doesn’t this work, but when I use print instead of return it does ? cheers


return can only be used inside functions.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.