banner

© 2004-19 ict4u.net

Python Datatypes

When you use a variable it is implicitly declared to the interpreter and you do not have to say there what type of data it will contain.

The most common Python data types are:

string

A sequence of one or more characters comprising anything that can be typed in from the keyboard
(including some special control characters such as newline)

integer

The Integer data type store whole numbers as a 32bit value

floating point

A numeric value that includes positive and negative values as well as decimal fractions

boolean

A data type with only two possible values, True (-1) or False (0).

Complex datatypes

list

Contains multiple values in an ordered sequence

dictionary

similar to a list but you can reference elements by a name - similar to a database field

tuple

Read only version of a list (ie cannot be modified at run time)