Question: Overview You will write a program that will use a while loop to prompt a user for first _ num and second _ num, divide
Overview
You will write a program that will use a while loop to prompt a user for firstnum and secondnum, divide firstnum by secondnum and store the result in a variable called answer, and then print it out cleanly. Your program should handle the divide by zero error and no other errors and should make use of a tryexeceptelse block. It should continue until the user enters a q
Expected Output
Example
What is the first number? or type q to quit
What is the second number?
is
What is the first number? or type q to quit
What is the second number?
You cannot divide by zero
What is the first number? or type q to quit
What is the second number?
is
What is the first number? or type q to quit q
The program is over
Specifications
You should submit a single file called MApy
It should follow the submission standards outlined here: Submission Standards
Your program must use a whileloop to collect user input until the user enters q
Your program must store the user input in variables called firstnum and secondnum and must store the calculation in a variable named answer.
Your program must catch the error of dividing by zero only using a tryexcecptelse block
Tips and Tricks
Besides the error handling casting is key to this one. Make sure you are converting variables to the type you need when you need it
HardCoded
Nothing is hardcoded for this file
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
