Question: LAB ACTIVITY 4.10.1: LAB: Exception handling to detect input string vs. integer main.py 1 # Split input into 2 parts: name and age 2

LAB ACTIVITY 4.10.1: LAB: Exception handling to detect input string vs. integer main.py 1 # Split input into 2 parts: name and age 2 parts = input().split() 3 name parts [0] 4 while name != '-1': 5 8 10 11 12 # FIXME: The following line will throw ValueError exception. # Insert try/except blocks to catch the exception. age = int(parts[1]) + 1 print("{} {}'.format(name, age)) # Get next line parts input().split() name = parts[0]] in k ctl
Step by Step Solution
There are 3 Steps involved in it
The given Python code is attempting to process user input by splitting it into two parts a name and ... View full answer

Get step-by-step solutions from verified subject matter experts