Your question is Convert Strings to Numbers. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Caesars Sportsbook receives wager amount fields as strings. Convert each string to a base-10 integer while preserving input order and handling malformed or out-of-range values safely.
Implement convert_number_strings(values, min_value, max_value). Trim surrounding whitespace, accept an optional leading + or -, and require at least one ASCII digit after the sign. Valid values within the inclusive range [min_value, max_value] become integers. Return None for empty strings, sign-only strings, strings containing non-digit characters, or values outside the range.
Do not use Python's int() conversion for the main solution. The input list itself must not be modified.
values, a list of strings; min_value and max_value, integers where min_value <= max_value.None for each input string.def convert_number_strings(values, min_value, max_value):