← Quiz: Design a News Feed: all 10 questions
Quiz: Design a News Feed · Question 7 of 10
What does this print? (code)
What does this print?
followers = {"asha": 120, "virat": 50_000_000, "priya": 300}
LIMIT = 100_000
pushed = sum(n for user, n in followers.items() if n < LIMIT)
print(pushed)
- A.50000420
- B.420
- C.120
- D.0
Answer & explanation
Correct answer: 420
Only accounts under the limit are pushed, so one post from each costs 120 + 300 = 420 feed inserts.
Can you get the rest right without peeking?
Take the timed Quiz: Design a News Feed quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →