FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Basic-Python-Programs/decimal_to_binary.py at main · 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
/
decimal_to_binary.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
9 lines (5 loc) · 285 Bytes
Breadcrumbs
Basic-Python-Programs
/
decimal_to_binary.py
Copy path
File metadata and controls
9 lines (5 loc) · 285 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
def
dec_to_bin
(
n
:
int
)
->
int
:
return
int
(
str
(
bin
(
n
))[
2
:])
#bin() is a function that takes in a string and converts it to binary provided the string is purely integer populated
num
=
int
(
input
(
'Enter a number (base 10): '
))
print
(
"It's value in binary is"
,
dec_to_bin
(
num
))
Back
|
FazBrowse Home
|
New Git URL