help me in this programing ⤵️
➡️ Python Program to Find Factorial of Number Using Recursion.
Don't spam please
Answers
Answer:
Explanation:
def recur_factorial(n):
if n == 1:
return n
else:
return n*recur_factorial(n-1)
num = int(input("Enter a number: "))
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))
for is the keyword in python which is used to form a loop whose definite length is known , it does not takes the last value . For example , the above loop will run till the number 'n' entered by the user and not till 'n+1' .
print is the keyword in python programming language . It print anything which is written within it .
input takes the input from the user in the form of string .
int converts the input into integer form .