From c57fc21d36da45d0011cdcba2bbfa5605099ce4f Mon Sep 17 00:00:00 2001 From: rakesh kumar Date: Tue, 26 Mar 2019 06:32:20 +0530 Subject: [PATCH] factorial by math function --- factorial.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/factorial.py b/factorial.py index 0a7dae2..f405164 100644 --- a/factorial.py +++ b/factorial.py @@ -9,8 +9,12 @@ # Licence: MIT-2.0 #------------------------------------------------------------------------------- #! python3 -fact=1 -n = int(input("Enter any integer no : ")) -for i in range(1,n+1): - fact = fact*i -print ("Factoril of" + str(n) +" is :" + str(fact)) +import math + +# fact=1 +# n = int(input("Enter any integer no : ")) +# for i in range(1,n+1): +# fact = fact*i +# print ("Factoril of" + str(n) +" is :" + str(fact)) + +print(math.factorial(10)) \ No newline at end of file