Write python code to input a number and calculate factorial of a number. For example if number is 5 then factorial will be 5x4x3x2x1 = 120.
Answers
Answered by
11
Codes :
_______________________
Output :
_______________________________
Additional Information :
• Python is a high level, dynamic, Object-Oriented programming language.
• Python was developed by Guido Van Rossum in 1991 , in Netherlands.
Features of Python are :
- Simple and easy.
- Free/Open Source.
- High-level language.
- Portable.
- Extensible and Embedded.
- Standard Library.
Answered by
2
Answer:
def fact(n):
if n==1:
return 1
else:
return n*fact(n-1)
n=int(input("enter a number"))
print(fact(n))
Similar questions