☼
⌃
☰

Python Data Types

Table of Contents

Python Data Types

Examples

Numbers

PYTHON
# Integer
age = 30

# Float
price = 19.99

Strings

PYTHON
name = "Gregory"
message = 'Hello, World!'

Lists

PYTHON
# Ordered, mutable collection
fruits = ["apple", "banana", "cherry"]

Tuples

PYTHON
# Ordered, immutable collection
coordinates = (10.0, 20.0)

Dictionaries

PYTHON
# Unordered, mutable collection of key-value pairs
person = {"name": "Gregory", "age": 30}

Booleans

PYTHON
is_active = True
has_permission = False