Chapter 2. Getting Started

Chapter Topics

  • Program Input/Output

  • Comments

  • Operators

  • Variables

  • Python Types

  • Indentation

  • Conditionals

  • Loops

  • Files

  • Errors

  • Functions

  • Classes

  • Modules

This “quick start” section is intended to “flash” Python to you so that any constructs recognized from previous programming experience can be used for your immediate needs. The details will be spelled out in succeeding chapters, but a high-level tour is one fast and easy way to get you into Python and show you what it has to offer. The best way to follow along is to bring up the Python interpreter in front of you and try some of these examples, and at the same time you can experiment on your own.

We introduced how to start up the Python interpreter in Chapter 1 as well as in the exercises (problem 1-4). In all interactive examples, you will see the Python primary ( >>> ) and secondary ( … ) prompts. The primary prompt is a way for the interpreter to let you know that it is expecting the next Python statement while the secondary prompt indicates that the interpreter is waiting for additional input to complete the current statement.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset