Introducing Python Object Types

Python's Core Data Types

Numbers

    1234, 3.1415, 3+4j, Decimal, Fraction

Strings

    'spam', "guido's", b'a\x01c'

Lists

    [1, [2, 'three'], 4]

Dictionaries

    {'food': 'spam', 'taste': 'yum'}

Tuples

    (1, 'spam', 4, 'u')

Files

    myfile = open('eggs', 'r')

Sets

    set('abc'), {'a', 'b', 'c'}

Other Core Types

    Booleans, types, None

Program unit types

    Functions, modules, classes

Implementation-related types

    Compiled code, stack tracebacks