Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Factorial number using recursion
#python 3.6.9 def recur_factorial(n): if n == 1: return n else: return n*recur_factorial(n-1) # take input from the user num = int(input("Enter a number: ")) # check is the number is negative if num < 0: print("Sorry, factorial does not exist for negative numbers") elif num == 0: print("The factorial of 0 is 1") else: print("The factorial of",num,"is",recur_factorial(num))
run
|
edit
|
history
|
help
0
PyDIP
DICTIONARY PROBLEM
Moore Voting Algorithm
Multinomial Naive Bayes
PythonClosure2
QuickSort
Bmi calculator dictionary
abc
time module time.time()
perform_math.py