+ 1
Little bit confusing!!
def print_num(x): for i in range(x): print(i) return print_num(10) how the answer is “0”
2 ответов
+ 4
After return statement, the loop terminates as no code can be executed after return statement in its block. As the very first value of i was 0, so only 0 will be printed.
+ 1
function will exit when a return is called. remove return from inside the loop