subject

Exception handling to detect input string vs. integerThe given program reads a list of single-word first names and ages (ending with -1), and outputs that list with the age incremented. The program fails and throws an exception if the second input on a line is a string rather than an integer. At FIXME in the code, add try and except blocks to catch the ValueError exception and output 0 for the age. Ex: If the input is:Lee 18Lua 21Mary Beth 19Stu 33-1then the output is:Lee 19Lua 22Mary 0Stu 34IN PYTHON PLEASE

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:40
When running anti-virus software , what could be a reason where recipitent is not guaranteed that data being streamed will not get interrupted?
Answers: 1
question
Computers and Technology, 23.06.2019 10:30
Would a ps4 wired controller work on an xbox one
Answers: 1
question
Computers and Technology, 23.06.2019 18:00
Apunishment or the threat of punishment used to enforce conformity. select the best answer from the choices provided t f
Answers: 1
question
Computers and Technology, 24.06.2019 22:00
Aobject is used for displaying the results of a question based on stored data. a. query b. report c. table d. form
Answers: 2
You know the right answer?
Exception handling to detect input string vs. integerThe given program reads a list of single-word f...
Questions
question
Physics, 09.03.2021 21:00
question
Mathematics, 09.03.2021 21:00
question
Mathematics, 09.03.2021 21:00
question
Mathematics, 09.03.2021 21:00
question
Mathematics, 09.03.2021 21:00
question
Mathematics, 09.03.2021 21:00
Questions on the website: 13722363