FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Awesome-Python-Programs/facinating_number.py at main · drahulsingh/Awesome-Python-Programs · GitHub
drahulsingh
/
Awesome-Python-Programs
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
1
Code
Issues
0
Pull requests
0
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Awesome-Python-Programs
/
facinating_number.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
27 lines (20 loc) · 713 Bytes
Breadcrumbs
Awesome-Python-Programs
/
facinating_number.py
Copy path
File metadata and controls
27 lines (20 loc) · 713 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
19
20
21
22
23
24
25
26
27
def
fascinating_num
(
num
):
if
num
<
100
:
return
False
num_str
=
str
(
num
)
multiplied_2
=
str
(
num
*
2
)
multiplied_3
=
str
(
num
*
3
)
concat_result
=
num_str
+
multiplied_2
+
multiplied_3
all_digits
=
'123456789'
for
digit
in
all_digits
:
if
concat_result
.
count
(
digit
)
!=
1
:
return
False
for
char
in
concat_result
:
if
char
not
in
all_digits
:
return
False
return
True
number
=
int
(
input
(
"Enter the number to check if it is a fascinating number: "
))
if
fascinating_num
(
number
):
print
(
f"
{
number
}
is a fascinating number."
)
else
:
print
(
f"
{
number
}
is not a fascinating number."
)
Back
|
FazBrowse Home
|
New Git URL