Basic functions

We learned at the beginning of this chapter that the first electronic calculator had four basic functions: addition, subtraction, multiplication, and division. We will be working on programming each of these functions, and we will also learn a fifth mathematical function that we can program for our calculator called modulo.

Through the beginning of this chapter, we will use the addition() function as our example. Once we have created and tested an addition() function that does what we want it to, we will then build our other functions.

Let's return to our example of the addition function in Chapter 2, Variables, Functions, and Users. Recall how we programmed this function:

The addition function in the preceding screenshot does perform ...

Get Python Projects for Kids now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.