1. Home
  2. Computing & Technology
  3. Python

Beginning Python: Data Types

From , former About.com Guide

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

Explore Python
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Python

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

All rights reserved.