0
can someone answer to me how i get 0 in this code
def print_nums(x): for i in range(x): print(i) return print_nums(10)
2 Answers
+ 1
range(10) yields values in range 0 ; 9.
The return keyword is used to exit directly a function call, so the loop runs once and prints 0, then exit.