FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Basic-Programs-Python/Programs/armstrong.py at master · ammode/Basic-Programs-Python · GitHub
ammode
/
Basic-Programs-Python
Public
forked from
Akshu-on-github/Basic-Programs-Python
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-Programs-Python
/
Programs
/
armstrong.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
18 lines (16 loc) · 534 Bytes
Breadcrumbs
Basic-Programs-Python
/
Programs
/
armstrong.py
Copy path
File metadata and controls
18 lines (16 loc) · 534 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# An Armstrong number is a three-digit number whose sum of the cubes of its digits is equal to the number itself
# Function to check if the given number is an Armstrong number
def
checkArmstrong
(
num
):
sum
=
0
temp
=
num
while
temp
>
0
:
digit
=
temp
%
10
sum
+=
digit
**
3
temp
//=
10
if
num
==
sum
:
print
(
num
,
"is an Armstrong number"
)
else
:
print
(
num
,
"is not an Armstrong number"
)
# Input & function call
num
=
int
(
input
(
"Please enter the number to be checked: "
))
checkArmstrong
(
num
)
Back
|
FazBrowse Home
|
New Git URL