Factorial of a Number in Python

 Factorial of a  Number in Python

n=float(input("Enter a Number :"))

fact =1

while(n>=1):

      fact=fact*n

      n-=1

print("Factorial :",fact)


Output : 

Enter a Number :5

Factorial : 120.0



0 comments:

Post a Comment

gurnoorsingh5974@gmail.com

Count Upper Case and Lower Case Word in a string (Python)

  Count Upper Case and Lower Case Word in a string     (Python) def string_test(s):     d={"UPPER_CASE":0, "LOWER_CASE":...