A zip with a missing partner
Predict the output · Medium · §10.5 Walking side by side
This code pairs account names with like counts and adds up the likes. Predict the output without running the code.
Code
names = ["mina", "jun", "sora", "dami"]
likes = [30, 12, 45]
total = 0
for name, n in zip(names, likes):
total += n
last = name
print(total, last)Solve this problem in your browser
Python runs in your browser and checks your answer right away. Hints and the answer are on the problem page.