

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 6
click for more info
Not enough gems
Cost: 6 gems
1: Python Numbers
incomplete
2: Numbers Review
incomplete
3: Floor Division
incomplete
4: Exponents
incomplete
5: Changing in Place
incomplete
6: Plus Equals
incomplete
7: Scientific Notation
incomplete
8: Logical Operators
incomplete
9: Not
incomplete
10: Binary Numbers
incomplete
11: Bitwise '&' Operator
incomplete
12: Bitwise '|' Operator
incomplete
13: Damage Meter
incomplete
14: Converting Binary
incomplete
Back
ctrl+,
Next
ctrl+.
This lesson's interactive features are locked, please to keep using them
Binary numbers are just "base 2" numbers. They work the same way as "normal" base 10 numbers, but with two symbols instead of ten.
Base-2 (binary) symbols: 0 and 1
Base-10 (decimal) symbols: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
Each digit's place value is double the place to its right. In a 4-digit binary number, the place values are:
Eights
Fours
Twos
Ones
For example, 0101 means:
0 eights
1 four
0 twos
1 one
So 0101 is 5 in decimal.
Try changing the bits:
You can write an integer in Python using binary syntax using the 0b prefix:
print(0b0001)
# Prints 1
print(0b0101)
# Prints 5Leading 0s are often added for visual consistency but do not change the value of a binary number.