Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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)
Comment

PREVIOUS NEXT
Code Example
Python :: make pandas df from np array 
Python :: add time delta pytohn 
Python :: csv write without new line 
Python :: location of python in cmd 
Python :: django models distinct 
Python :: convert torch to numpy 
Python :: multiply column of dataframe by number 
Python :: ready command discord.py 
Python :: time counter in python 
Python :: convert excel to csv using python 
Python :: delete rows in dataframe pandas 
Python :: get max value column pandas 
Python :: python stop daemon thread 
Python :: python [a]*b means [a,a,...b times] v2 
Python :: Violin Plots, Python 
Python :: cprofile implementation 
Python :: remove duplicates from list python 
Python :: nlargest hierarchy series pandas 
Python :: check numpy arrays equal 
Python :: python clear screen windows and linux 
Python :: how to import data from csv to jupyter notebook 
Python :: python read from txt file 
Python :: get last file in directory python 
Python :: add headers tp requests python 
Python :: drop row based on NaN value of a column 
Python :: download youtube-dl python 
Python :: author nextcord interactions 
Python :: python string cut substring 
Python :: python program to count vowels in a string 
Python :: django form widget 
ADD CONTENT
Topic
Content
Source link
Name
2+1 =