I want to run the following code in vi editor:
def factorial( n ):
if n <1: # base case
return 1
else:
returnNumber = n * factorial( n - 1 ) # recursive call
print(str(n) + '! = ' + str(returnNumber))
return returnNumber
I want to give a runtime input for the value n while running the program in vi editor. I don't know how to give run time user input for a python program in vi editor. Also wants to know what changes need to be done in the code while running the code in vi editor. Can I have a resolution for this? I am able to run the code but unable to pass the value of n.
I am running this in Putty and I am using Python3.