The while loop reads values from input until an integer is read. Add an except block in
Fantastic news! We've Found the answer you've been seeking!
Question:
The while loop reads values from input until an integer is read. Add an except block in the while loop to handle an exception and output 'Bad input for month of birth is discarded'.
found_one = False while not found_one: try: month_of_birth = int(input()) found_one = True print(f'Month of birth: {month_of_birth}') print('Processed one valid input value')
Related Book For
Auditing Cases An Interactive Learning Approach
ISBN: 978-0132423502
4th Edition
Authors: Steven M Glover, Douglas F Prawitt
Posted Date: