runtime
62 / 500
question 62 Lists & Tuples · easy

The late-deliveries list crashes

Two lists line up by position: order_ids[i] took days[i] days to arrive. The program should print the IDs of the orders that took more than 5 days, as a list. It crashes with an AttributeError, and once that is fixed it still misses an order. Fix both bugs.

Inputsorder_ids and days, two lists of the same length
Printsa list of the IDs whose delivery took more than 5 days, in their original order
Examplesthe starter's lists → ['O101217', 'O108752']; days [1, 2] → []
Expected output1 line
  1. 1['O101217', 'O108752']

Loading your progress…

The late-deliveries list crashes — Python practice · Runtime