+ 2
Can anyone explain?
def print_nums(x): for i in range(x): print(i) return print_nums(10) why is the result 0?
5 Risposte
+ 2
Because of the return.
It acts like a break within a function.
Remove the keyword it would work
+ 2
Great advice,thanks sir
+ 1
Return is not necessary for a function in Python, unlike some other languages
+ 1
Pls JUST DON'T SAY SIR.
I am just 14
+ 1
I look old if you say that.
I like being young 😂😂😂