© Irv Kalb 2018
Irv KalbLearn to Program with Python 3https://doi.org/10.1007/978-1-4842-3879-0_2

2. Variables and Assignment Statements

Irv Kalb1 
Mountain View, California, USA
This chapter covers the following topics:
  • A sample Python program

  • Building blocks of programming

  • Four types of data

  • What a variable is

  • Rules for naming variables

  • Giving a variable a value with an assignment statement

  • A good way to name variables

  • Special Python keywords

  • Case sensitivity

  • More complicated assignment statements

  • Print statements

  • Basic math operators

  • Order of operations and parentheses

  • A few small sample programs

  • Additional naming conventions

  • How to add comments in a program

  • Use of “whitespace”

  • Errors in programs

A Sample Python Program

Let’s jump right in and see an example of ...

Get Learn to Program with Python 3: A Step-by-Step Guide to Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.