ask_int(prompts) simulating a retry prompt: prompts is a list of pre-recorded user inputs. Return the first one that parses as an int; if none do, return None. This mirrors the classic while True: try: ... except: continue input loop, but testable without real input().ask_int(['abc', ' 7 ', '9'])
7
The second entry is the first valid integer.
Loop and attempt int() on each.
Return inside the try on success.