O'Reilly logo

Doing Math with Python by Amit Saha

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

1Working with Numbers

image

Let’s take our first steps toward using Python to explore the world of math and science. We’ll keep it simple now so you can get a handle on using Python itself. We’ll start by performing basic mathematical operations, and then we’ll write simple programs for manipulating and understanding numbers. Let’s get started!

Basic Mathematical Operations

The Python interactive shell is going to be our friend in this book. Start the Python 3 IDLE shell and say “hello” (see Figure 1-1) by typing print('Hello IDLE') and then pressing ENTER. (For instructions on how to install Python and start IDLE, see Appendix A.) IDLE obeys your command ...

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