-1
This happens because a return
will always be an end of a function.
You can have infinities return
, at the first touch your function will be finished and will return the object that Return is pointing to.
Example:
Function that prints a list.
In both cases they will receive as input:
[1,2,3,4]
Below two cases, the last one being the one you are using.
def printar(n):
for x in n:
print(x)
This would be a perfect skeleton for your code. For the result would be:
1
2
3
4
However, what you’re trying to do is:
def printar(n):
for x in n:
return(x)
That the result would be:
1
Fabiano do not use image, edit the question and put the code, doing so you help anyone to help you.
– NoobSaibot