2Calculations and Variables

Image

Now that you’ve installed Python and know how to start the Python Shell, you’re ready to do something with it. We’ll begin with some simple calculations and then learn how to use variables. Variables are a way of storing things in a computer program, and they can help you write useful programs.

Calculating with Python

Normally, when asked to find the product of two numbers like 8 × 3.57, you would use a calculator or a pencil and paper. Well, how about using the Python Shell to perform your calculation? Let’s try it.

Start the Python Shell by double-clicking the IDLE icon on your desktop, or if you’re using Ubuntu, ...

Get Python for Kids, 2nd Edition 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.