New functions – subtraction, multiplication, and division

Now that we have created an addition() function that accepts data from the user and converts it into numbers, we are ready to create functions for subtraction, multiplication, and division.

If you are coming back to this after a break, perform the following steps:

  1. Open your Python shell so that you can test your code as you write.
  2. Next, open your text editor (jEdit in Mac/Linux and Notepad ++ in Windows).
  3. Have both windows open on your desktop as you program.
  4. When you successfully write and test a line or a few lines of code in the Python shell, copy the lines into your text editor and then Save Your Work to the file that you created earlier in this chapter.


Save your work early ...

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.