1 · Learn and predict
Read this worked example. Predict its output, run it in Python 3, and explain how variables change.
def valid_age(text):
if not text.isdigit():
return False
age = int(text)
return 11 <= age <= 18
for sample in ["15", "-1", "nineteen", "19"]:
print(sample, valid_age(sample))