← Quiz: Error Detection and Correction: all 10 questions
Quiz: Error Detection and Correction · Question 9 of 10
What does this print? (code)
What does this print?
a, b = 0b10110, 0b11100
print(bin(a ^ b).count("1"))
- A.1
- B.2
- C.3
- D.5
Answer & explanation
Correct answer: 2
XOR marks the differing positions (01010), and there are two of them.
Can you get the rest right without peeking?
Take the timed Quiz: Error Detection and Correction quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →