Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Create Check Armstrong numbers.py #393

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Check Armstrong numbers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
num = int(input("Enter a number: "))
sum = 0
temp = num
while temp > 0:
num2 = temp % 10
sum += num2 ** 3
temp //= 10

if num == sum:
print(num,"is an Armstrong number")
else:
print(num,"is not an Armstrong number")