Baby Calculator

Write a calculator program that allows the user to add, subtract, multiply or divide two numbers. (This is sometimes called a “four-function” calculator.)

The program must loop until they enter a zero as the first number. Use a break statement when that happens.

>2 + 3
5
>4 * 9
36
>0 + 2
Bye, now.

Files Needed


©2021 Daniel Gallo

This assignment is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License.

Creative Commons License

Adapted for Python from Graham Mitchell’s Programming By Doing