Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 1
Again about "return"!!š š
def func(x): for i in range(x): res+=1 return res print (func(4))
2 Respostas
+ 2
Because the range function starts from 0, and 0 is printed, then the return breaks the function.
+ 1
def print_num(x):
for i in range(x):
print(i)
return
print_num(10)
how the answer is ā0ā