Math Basics

Now it's time to start writing some instructions for computers!

The first thing you need to do is open a program called Idle. If you've followed the instructions from Lesson 1, it should be on your desktop or in your Applications folder.

Let's get started with some very simple math.

Go ahead and type these expressions one at a time. After each one, hit the Enter key and see what happens.

>>> 1 + 2

>>> 12 - 3

>>> 9 + 5 - 15

We're using some symbols you probably already know - the plus and minus signs. In the programming world, we call these operators.

Operators  
add +
subtract

By the way, you have just started writing Python.


Answers:

>>> 1 + 2
3
>>> 12 - 3
9
>>> 9 + 5 - 15
-1