Python Data Types: Integers, Floats, Strings, Booleans, Lists, Tuples, Dictionaries, Sets

Published on May 15, 2025 by Aman K Sahu

Integers

🔹 Whole numbers, positive or negative, without decimals.

age = 25

Floats

🔹 Numbers that contain decimal points.

height = 5.9

Strings

🔹 Sequence of characters enclosed in quotes.

name = "Alice"

Booleans

🔹 Represents one of two values: True or False.

is_active = True

Lists

🔹 Ordered and changeable collection. Allows duplicate members.

fruits = ["apple", "banana", "cherry"]

Tuples

🔹 Ordered and unchangeable collection. Allows duplicates.

coordinates = (10.5, 20.3)

Dictionaries

🔹 Collection of key-value pairs. Unordered and changeable.

person = {"name": "Alice", "age": 25}

Sets

🔹 Unordered collection with no duplicate elements.

unique_numbers = {1, 2, 3, 2}

🟢 The set will automatically remove the duplicate 2.

Previous: Python Basic Syntax
Next: Python Control Flow