0
0
Intro to Computingfundamentals~10 mins

Bits and bytes explained in Intro to Computing - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to convert 8 bits into 1 byte.

Intro to Computing
byte = [1] bits
Drag options to blanks, or click blank then click option'
A1
B4
C16
D8
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing bits with bytes and using 4 or 16 instead of 8.
Using 1 bit as a byte.
2fill in blank
medium

Complete the code to calculate how many bits are in 3 bytes.

Intro to Computing
bits = 3 [1] 8
Drag options to blanks, or click blank then click option'
A+
B*
C-
D/
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition instead of multiplication.
Dividing or subtracting which does not give correct total bits.
3fill in blank
hard

Fix the error in the code to convert bits to bytes correctly.

Intro to Computing
bytes = bits [1] 8
Drag options to blanks, or click blank then click option'
A/
B*
C+
D-
Attempts:
3 left
💡 Hint
Common Mistakes
Multiplying bits by 8 instead of dividing.
Adding or subtracting which does not convert correctly.
4fill in blank
hard

Fill both blanks to create a dictionary mapping bytes to bits for 1 to 4 bytes.

Intro to Computing
bytes_to_bits = {x: x [1] 8 for x in range(1, 5) if x [2] 4}
Drag options to blanks, or click blank then click option'
A*
B<=
C>
D+
Attempts:
3 left
💡 Hint
Common Mistakes
Using addition instead of multiplication.
Using wrong comparison operators like '>' instead of '<='.
5fill in blank
hard

Fill all three blanks to create a dictionary of bytes to bits for 1 to 5 bytes, only if bits are greater than 16.

Intro to Computing
bytes_to_bits = { [1]: [2] for [3] in range(1, 6) if [2] > 16 }
Drag options to blanks, or click blank then click option'
Ab
Bb * 8
Dx
Attempts:
3 left
💡 Hint
Common Mistakes
Using inconsistent variable names.
Not multiplying bytes by 8 to get bits.
Incorrect condition for filtering bits.