← Quiz: DNS in Depth: all 10 questions
Quiz: DNS in Depth · Question 10 of 10
What does this print? (code)
What does this print?
cache = {"skills101.in": ("203.0.113.7", 500)} # (IP, expires_at)
for now in (100, 499, 500, 600):
hit = now < cache["skills101.in"][1]
print("hit" if hit else "miss", end=" ")
print()
- A.hit hit hit miss
- B.hit hit miss miss
- C.hit miss miss miss
- D.miss miss hit hit
Answer & explanation
Correct answer: hit hit miss miss
The entry is valid only while now is less than 500, so 500 and 600 are misses.
Can you get the rest right without peeking?
Take the timed Quiz: DNS in Depth quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →