← Quiz: Python Variables and Data Types: all 15 questions
Quiz: Python Variables and Data Types · Question 8 of 15
What does this print? (code)
What does this print?
a, b = 3, 4
a, b = b, a
print(a, b)
- A.3 4
- B.4 3
- C.4 4
- D.An error
Answer & explanation
Correct answer: 4 3
Tuple unpacking swaps values in one line.
Can you get the rest right without peeking?
Take the timed Quiz: Python Variables and Data Types quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →