Answers for "recursive python program to print numbers from n to 1"

0

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)
Posted by: Guest on May-09-2020

Code answers related to "recursive python program to print numbers from n to 1"

Python Answers by Framework

Browse Popular Code Answers by Language