Input validation ensures that the data we receive from a user can be manipulated without causing errors or bugs in the subsequent code. You've likely seen something similar to the following two code snippets, each for taking a string from input and converting it to an int:
#using isdigit
if val.isdigit(): val = int(val)
#using try/except
try: val = int(val)
except ValueError: print("Invalid, try again")