0
Can someone explain it?
def print_nums(x): for i in range(x): print(i) return print_nums(10)
2 Réponses
+ 8
Anish Chhabra
Output is 0
You have passed 10 and used for loop from 0 to 10 range then you printed and returned from the function in the very first iteration so, it will print only 0.
+ 2
The for loop only run once. It prints i whereas i is 0. And return which ends the function. No matter how big the number is you passed to the function. It's always 0.