parse_age(raw) that safely converts a user-entered string raw into a valid age. Return the integer age if raw represents a whole number between 0 and 120 inclusive. Otherwise, return the string "invalid age". Handle non-numeric strings, negative numbers, decimals, and out-of-range values.parse_age("29")29
Valid integer within range.
parse_age("-5")'invalid age'
Negative ages are not allowed.
parse_age("abc")'invalid age'
Not a number at all.
parse_age("30.5")'invalid age'
Not a whole number.
Use try/except around int(raw) to catch non-numeric strings (int() rejects "30.5").
After parsing, check the 0-120 bound explicitly.