"copy" this given code and "paste" it on the python display to run the programme.
Here, i will show it by TWO methods.
⇒ FIRST METHOD 👇
n = int(input("Enter Number:"))
fact = 1
while(n >=2):
fact = fact*n
n-=1
print("Factorial=" ,fact)
⇒SECOND METHOD 👇
n = int(input("Enter Number:"))
fact = 1
for i in range(n,1,-1):
fact = fact*i
print("Factorial=" ,fact)
Comments
Post a Comment