Python Built-In Types

Simple Values

Type Example Description
int x = 1 integers
float x = 1.0 floating point numbers
complex x = 1 + 2j complex numbers
bool x = True boolean: True/False values
str x = ’abc’ string: characters or text
NoneType x = None null value

Integers

Floating-Point Numbers

Complex Numbers

String Type

Boolean Type

None Type

Built-In Data Structures

Type Example Description
list [1, 2, 3] ordered collection
tuple (1, 2, 3) immutable ordered collection
dict {’a’: 1, ’b’: 2} unordered (key,value) mapping
set {1, 2, 3} unordered collection

Lists

List Indexing

List Slicing

Tuples

Dictionaries

Sets