1. Home
  2. Computing & Technology
  3. Python

Beginning Python: Data Types

By Al Lukaszewski, About.com

2 of 10

Integers

An integer in Python, also known as a 'numeric literal', is simply a name used for a numeric value. For this reason, these values are commonly called integers even if they are assigned the value of a real number in the form of an integer and a decimal value. Any numeric value can be assigned to it at any time, overwriting the previous value.

To assign a value to an integer variable, one writes a statement after the following template:

<numeric literal name> = <numeric literal value>

Some examples are:

x = 1500
pi = 3.14

2 of 10

Explore Python

More from About.com

  1. Home
  2. Computing & Technology
  3. Python

©2008 About.com, a part of The New York Times Company.

All rights reserved.