Show-Me-the-Code / python

Show Me the Code Python version.
https://github.com/Show-Me-the-Code/show-me-the-code
MIT License
3.91k stars 2.74k forks source link

Create Simple Calculator by Using Functions #361

Open AyushSharma-code opened 3 years ago

AyushSharma-code commented 3 years ago

In this program, we ask the user to choose an operation. Options 1, 2, 3, and 4 are valid. If any other input is given, Invalid Input is displayed and the loop continues until a valid option is selected.

Two numbers are taken and an if...elif... else branching is used to execute a particular section. User-defined functions add(), subtract(), multiply() and divide() evaluate respective operations and display the output.