It's my first question here, so I'll be brief: I'm having trouble with the code below:
def nat(n):
if n == 50:
return 0
else:
return nat(n+1)
print(nat(1))
It happens that it's a recursive question in Python, I should print the first 50 natural numbers, but my output always returns '0':
0
I do not understand almost anything about the subject, I have already solved the question in C and Python, but using repetition structures, but in this way I was presented, I can not solve the same problem. Does anyone have an orientation of where is the error (s)? Reminder, I do not need problem solving, just a guide where I'm wrong, if at all possible.