recursive python program to print numbers from n to 1 code example
Example: recursive python program to print numbers from n to 1
# Read the input
n = int(input())
def rec(n):
if n==0:
print(0)
else:
print(-n)
rec(n-1)
print(n)
rec(n)