question 63 Lists & Tuples · easy
Order numbers from mixed IDs
An export mixes Runtime Market order IDs (O104839) with retail invoice numbers (C489528). Keep only the IDs that start with O, turn each into its number (104839), and print the list of numbers. Then print the largest of those numbers (the most recent order), or None if there were no order IDs.
Input
ids, a list of textsLine 1a list of the numbers from IDs starting with
O, in their original orderLine 2the largest of those numbers, or
NoneExamples
["O100043", "O104839", "C489528", "O101217"] → [100043, 104839, 101217] then 104839; ["C1"] → [] then NoneExpected output2 lines
- 1[100043, 104839, 101217]
- 2104839