O'Reilly logo

Hello World! Second Edition: Computer Programming for Kids and Other Beginners by Warren Sande and Carter Sande

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3. Basic Math

When we first tried using Python in interactive mode, we saw that it can do simple arithmetic. Now we’re going to see what else Python can do with numbers and math. You might not realize it, but math is everywhere! Especially in programming, math is used all the time. That doesn’t mean you have to be a math whiz to learn programming, but think about it. Every game has a score of some kind that has to be added up. Graphics are drawn on the screen using numbers to figure out the positions and colors. Moving objects have a direction and speed, which are described with numbers. Almost any interesting program is going to use numbers and math in some way. So let’s learn some basics about math and numbers in Python.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required