You are here:About>Computing & Technology>Python> Beginning Python> Python Programming - Before Programming Python - Statements and Assignments - Three Statements - Part 1
About.comPython
Newsletters & RSSEmail to a friendSubmit to Digg

How a Computer Reads a Program

From Al Lukaszewski,
Your Guide to Python.
FREE Newsletter. Sign Up Now!

Three Statements - Part 1

There are three kinds of statements in programming: assignment, control, and operation. I shall discuss each of them in greater depth in the respective tutorials on Python. In the next couple of pages, however, I will discuss their basic characteristics.

Assignment statements are perhaps the simplest of the three. In assignment, the value on the right side of the equal sign ('=') is assigned to a variable name on the left. The more common way of describing the statement "x = 25" is to say that 'x equals 25'. As long as x is equivalent to '25', one may refer to the variable 'x' instead of '25' wherever needed. However, one must be careful. If a program is dependent upon x being '25' and x is later assigned a new value, perhaps '26', then every calculation that relies upon x being equivalent to '25' will change, sometimes with unpredictable results.

  1. Clueless Computers
  2. Reserved Words Are Key
  3. Picking an Argument - Part 1
  4. Picking an Argument - Part 2
  5. Picking an Argument - Part 3
  6. Three Statements - Part 1
  7. Three Statements - Part 2
  8. Summary

<< Previous | Next >>

 All Topics | Email Article | | |
Advertising Info | News & Events | Work at About | SiteMap | Reprints | HelpOur Story | Be a Guide
User Agreement | Ethics Policy | Patent Info. | Privacy Policy©2008 About, Inc., A part of The New York Times Company. All rights reserved.