Skip to content

Commit

Permalink
Create Strong.py
Browse files Browse the repository at this point in the history
  • Loading branch information
3aryansingh committed Oct 7, 2020
1 parent 0e083ea commit 845a773
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Strong.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
num = int(input(" Enter the Number:"))
sum = 0
temp = num

while(temp > 0):
fact = 1
rem = temp % 10

for i in range(1, rem + 1):
fact = fact * i

print("Factorial of %d = %d" %(rem, fact))
sum = sum + fact
temp = temp // 10

print("\n Sum of Factorials of a Given Number %d = %d" %(num, sum))

if (sum == num):
print(" The given number is a Strong Number")
else:
print(" The given number is not a Strong Number")

0 comments on commit 845a773

Please sign in to comment.