ThePythonBook

Python Fundamentals

Variables, data types, strings, operators, and your first programs

10tutorials
53exercises
210minutes
930XP
10 tutorials in this category

Python for Beginners: Your First Program in 5 Minutes

Write your first Python program in minutes — print(), variables, and f-strings. No setup, just code.

beginner20m460

Python Variables and Data Types: A Practical Introduction

How Python stores data: int, float, str, bool, and None. You'll also learn type checking and when to convert between types.

beginner25m695

Python Numbers: Integers, Floats, and Math You\

Arithmetic in Python — integers, floats, division quirks, modulo, rounding, and a few real-world calculations to try.

beginner20m6110

Python Strings: Create, Access, Slice, and Manipulate Text

Strings are everywhere in Python. Here you'll slice them, index them, concatenate them, and get comfortable with text manipulation.

beginner25m7135

Every Python String Method Explained with Examples

The string methods you'll use daily: upper(), split(), join(), replace(), strip(), find(), and friends.

beginner25m6100

Python String Formatting: f-strings, format(), and % Operator

Three ways to format strings in Python — f-strings, .format(), and the older % style. You'll know when to reach for each.

beginner20m575

Python Booleans, Comparisons, and All Operators Explained

True, False, and the logic that glues your programs together — comparisons, and/or/not, truthiness, and operator precedence.

beginner25m690

Python Input and Output: print(), input(), and Formatting

print() does more than you think. Pair it with input() and you've got the basics of user interaction.

beginner15m490

Python Type Conversion: How to Convert Between Data Types

int(), float(), str(), bool() — how Python converts between types, when it happens automatically, and the gotchas to avoid.

beginner20m585

Writing Clean Python: Comments, Docstrings, and PEP 8

Comments, docstrings, naming conventions, and PEP 8 — the habits that separate readable code from a wall of text.

beginner15m490