In this project, we are creating a simple calculator thta can add, subtract, multiply or divide depending on the user input. For this project, knowledge of the following python topics is needed:
- User-defied functions.
- Functions
- Function Arguments
We request the user to select an operation in this program. 1, 2, 3, and 4 are all viable choices. Any further input results will display Invalid Input, and the loop keeps going until a valid option is chosen.
A particular segment is carried out by using an if...elif...else branching and two numbers. The user-defined functions multiply(), divide(), add(), and subtract() evaluate their associated operations and display the output.
The output: