FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Basic-Python-Programs/ArmstrongNumberCheck.py at Test · gitishman/Basic-Python-Programs · GitHub
gitishman
/
Basic-Python-Programs
Public
forked from
souravjain540/Basic-Python-Programs
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Basic-Python-Programs
/
ArmstrongNumberCheck.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
9 lines (7 loc) · 393 Bytes
Breadcrumbs
Basic-Python-Programs
/
ArmstrongNumberCheck.py
Copy path
File metadata and controls
9 lines (7 loc) · 393 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
print
(
"An Armstrong Number is a number which is equal to the sum of the cubes of it's digits."
)
inputNumber
=
input
(
"Enter a number to check if it's an Armstrong Number or not: "
)
sumOfCubes
=
0
for
digit
in
inputNumber
:
sumOfCubes
+=
int
(
digit
)
**
3
if
sumOfCubes
==
int
(
inputNumber
):
print
(
inputNumber
,
"is an Armstrong Number."
)
else
:
print
(
inputNumber
,
"is NOT an Armstrong Number."
)
Back
|
FazBrowse Home
|
New Git URL