W3Schools Python Types Guide Learn Variables Strings Integers Lists Dicts Quick Reference

Logan Jul 13, 2026

Welcome to W3Schools' Python Types guide. If you're new to Python or looking to brush up on your skills, understanding the different types of data in Python is a crucial first step. Python's data types seem simple at first glance, but they're powerful and diverse, enabling you to handle various kinds of data.

All Important Python Functions for Beginners (Complete Cheat Sheet)
All Important Python Functions for Beginners (Complete Cheat Sheet)

Let's dive into the basics of Python types, their usage, and how W3Schools can help you learn them.

the cover of collection data types in python, with an image of numbers and symbols
the cover of collection data types in python, with an image of numbers and symbols

Number Data Types

Python has several number types to handle different types of numeric values.

Python Developer (@Python_Dv) on X
Python Developer (@Python_Dv) on X

Here are the two primary number types in Python:

Integer (int)

Python Cheat Sheet for Beginners 2026 | Python Basics, Syntax, Loops, Functions & Variables
Python Cheat Sheet for Beginners 2026 | Python Basics, Syntax, Loops, Functions & Variables

Integers are whole numbers, both positive and negative, without decimals. They can be written in three ways: decimal, hexadecimal, or octal.

Example:

x = 10
y = 0b1010
z = 0o12

Floating-point number (float)

Python Learning Path for Beginners 2026 🚀
Python Learning Path for Beginners 2026 🚀

Floating-point numbers, or floats, are numbers with decimals. They can also be written with scientific notation when dealing with very large or small numbers.

Example:

x = 35.0
y = 1e-3

String Data Types

Different Types of Variables in Python with Examples
Different Types of Variables in Python with Examples

Strings are sequences of characters enclosed in quotes. Python allows for several types of string literals, including single line, multi-line, raw string, and byte string.

Here's how you can declare multi-line strings and raw strings:

Data Types In Python
Data Types In Python
💜 Python Data Types Cheat Sheet 🐍 Know your data, write better code! ✨
💜 Python Data Types Cheat Sheet 🐍 Know your data, write better code! ✨
PYTHON BASICS
PYTHON BASICS
required functions
required functions
Python Data Types
Python Data Types
Python Cheat Sheet for Beginners
Python Cheat Sheet for Beginners
Python Data Types Explained Visually | Beginner Python Guide
Python Data Types Explained Visually | Beginner Python Guide
the types of numbers in python are shown on top of each other, and below it is
the types of numbers in python are shown on top of each other, and below it is
Python Unit 3 Cheat Sheet 🐍 | Functions, Arguments, Lambda & Modules (AKTU)
Python Unit 3 Cheat Sheet 🐍 | Functions, Arguments, Lambda & Modules (AKTU)
python data types /types of data
python data types /types of data
7 PYTHON LIBRARIES EVERY DEVELOPER SHOULD LEARN
7 PYTHON LIBRARIES EVERY DEVELOPER SHOULD LEARN
30-Day Python Learning Plan for Beginners | Complete Python Roadmap to Learn Coding Fast
30-Day Python Learning Plan for Beginners | Complete Python Roadmap to Learn Coding Fast
Python Learning Path for Beginners 2026 🚀
Python Learning Path for Beginners 2026 🚀
6 Python Data Types Every Beginner Should Know
6 Python Data Types Every Beginner Should Know
Shortcut to learn Python.[Cheatsheet]
Shortcut to learn Python.[Cheatsheet]
🐍 Python for Everything 🚀 | Best Python Libraries & Tools Every Developer Should Learn
🐍 Python for Everything 🚀 | Best Python Libraries & Tools Every Developer Should Learn
the different types of logos are shown in this diagram, and there is also an info sheet
the different types of logos are shown in this diagram, and there is also an info sheet
Python Notes for Beginners (Easy + Quick Guide)
Python Notes for Beginners (Easy + Quick Guide)
three different types of python programming
three different types of python programming

Multi-line String

str = "This is a multiline string." print(str
"This is the second line.")

Raw String

str = r"This is a raw string." print(str)

W3Schools provides interactive tutorials and a 'Try It Yourself' editor for each data type, making it easy to understand and practice these concepts.

Sequence Data Types

Python includes several sequence types that store collections of objects. They are immutable and heterogeneous.

Let's explore the primary sequence data types:

List (list)

Lists are ordered and changeable, enclosed in square brackets. They allow duplicate elements.

Example:

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

Tuple (tuple)

Tuples are ordered and unchangeable, enclosed in parentheses. They allow duplicate elements.

Example:

tuple = ("apple", "banana", "cherry")

W3Schools' Python Types guide also covers sets, frozensets, byte arrays, byte arrays, and range types. Each topic includes clear explanations, examples, and interactive exercises to help reinforce your learning.

At W3Schools, our aim is to provide a comprehensive, stress-free learning environment for Python's data types. With practice exercises and real-world examples, you'll be well on your way to understanding and using these essential concepts with ease. So, dive into our Python Types guide and start your journey today!