0
What is the output of this code?
def func(x): res = 0 for i in range(x): res +=1 return res print(func(4)) The output of the code is 6. But I am confused how is it so if i take x as 4?
2 Réponses
+ 4
You made a mistake somewhere, output will be 4. But if replace 1 on i: output will be 6
0
answer is 6