0
Please explain the working of below code as i am not able to understand
What is the highest number output by this code? def print_nums(x): for i in range(x): print(i) return print_nums(10)
2 ответов
+ 5
The return function is inside the for loop. The loop only executes once, (printing 0) and exits cos of the return statement. if the return statement were outside the for loop it'll print numbers in the range 0-9
+ 1
Thank you !