Question: write a program that emulates a calculator:In python 1 . Multiplication 2 . Division 3 . Addition 4 . Subtraction 5 . Quit Display a
write a program that emulates a calculator:In python
Multiplication
Division
Addition
Subtraction
Quit
Display a menu where the user would select his choice by typing a number. If the user types an invalid choice, then display a msg error
The user input are float numbers
Format your output floating number to digits after the f
Treat the exception where a user type zero to divide by
Helpful HINTs:
If you do not castconvert your input ie choice data type to an int, then
it will be read as a character. Thus, you will have to compare it to a
character and not to an int!
choice inputchoice :
use if choice : #instead of if choice
For calculating the input a b make sure you cast your input type to a
float data type when reading input, otherwise your input will be read as a
character
floatinputEnter a:
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
