← Quiz: Unique ID Generator: all 15 questions
Quiz: Unique ID Generator · Question 7 of 15
What does this print? (code)
What does this print?
servers = 3
ids = {k: [k + servers * i for i in range(3)] for k in (1, 2, 3)}
print(ids[2])
- A.[2, 3, 4]
- B.[2, 5, 8]
- C.[2, 4, 6]
- D.[3, 6, 9]
Answer & explanation
Correct answer: [2, 5, 8]
Database 2 in a group of 3 hands out 2, 5, 8 — the auto-increment-with-steps scheme.
Can you get the rest right without peeking?
Take the timed Quiz: Unique ID Generator quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →