Standard data types

With our first script complete, it is now time to understand the basic data types of Python. These data types are similar to those found in other programming languages, but are invoked with a simple syntax described in the following table and sections. For a full list of standard data types available in Python, visit the official documentation at http://docs.python.org/2/library/stdtypes.html.

Data type

Description

Example

str

String

str(), "Hello", 'Hello'

unicode

Unicode characters

unicode(), u'hello', "world".encode('utf-8')

int

Integer

int(), 1, 55

float

Decimal precision integers

float(), 1.0, .032

bool

Boolean Values

bool(), True, False

list

List of elements

list(), [3, 'asd', True, 3]

dictionary ...

Get Learning Python for Forensics now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.