Checking the lengths before pairing
Fill in the blanks · Medium · §10.5 Walking side by side
This code prints account names paired with like counts. If the two lists have different lengths, the pairs do not line up and some items silently disappear. So check the lengths before pairing, and if they differ, print only Lengths differ. Fill in the two blanks.
Code with blanks
names = ["dami", "yuna", "taeo"]
likes = [8, 21, 14]
if ____:
for name, n in ____:
print(name, n)
else:
print("Lengths differ")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.