Question: Complete the following tasks in PYTHON: Write an exception handler to catch ValueError and output 'int ( ) : Input is not an integer. '
Complete the following tasks in PYTHON:
Write an exception handler to catch ValueError and output 'int: Input is not an integer.
Write an exception handler to catch ZeroDivisionError and output 'totalrainfall nummonths: Denominator cannot be zero.
Example:
Ex: If the input is bread, then the output is:
int: Input is not an integer.
Ex: If the input is then the output is:
totalrainfall nummonths: Denominator cannot be zero.
Provided code:
try:
nummonths intinput
totalrainfall
printfAverage rainfall per month is totalrainfall nummonths
# Your code goes here
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
