FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
programmingWithPythonCode/simple_datatypes/int_binary.py at main · thomasWeise/programmingWithPythonCode · GitHub
thomasWeise
programmingWithPythonCode
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
programmingWithPythonCode
/
simple_datatypes
/
int_binary.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
25 lines (18 loc) · 1.06 KB
Breadcrumbs
programmingWithPythonCode
/
simple_datatypes
/
int_binary.py
Copy path
File metadata and controls
25 lines (18 loc) · 1.06 KB
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
bin
(
22
)
# Convert 22 to a text string with bit values.
0b10110
# 22 in binary notation, indicated by prefix 0b.
bin
(
15
)
# Convert 15 to a text string with bit values.
0b1111
# 15 in binary notation, indicated by prefix 0b.
22
|
15
# bit-wise 'or' of 0b10110 and 0b1111
bin
(
31
)
# Convert 31 to a text string with bit values.
22
&
15
# bit-wise 'and' of 0b10110 and 0b1111
bin
(
6
)
# Convert 6 to a text string with bit values.
22
^
15
# bit-wise 'exclusive or' of 0b10110 and 0b1111
bin
(
25
)
# Convert 25 to a text string with bit values.
22
<<
1
# Shift 22 left by 1 step == 22 * 2.
bin
(
44
)
# Convert 44 to a text string with bit values.
22
>>
2
# Shift 22 right by 2 steps == 22 // 4
bin
(
5
)
# Convert 5 to a text string with bit values.
hex
(
22
)
# Convert 22 to a string in hexadecimal notation.
0x16
# 22 in hexadecimal notation, indicated by prefix 0x.
oct
(
22
)
# Convert 22 to a string in octal notation.
0o26
# 22 in octal notation, indicated by prefix 0o.
Back
|
FazBrowse Home
|
New Git URL