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

Learn Python from scratch. Write your first Python program, understand print(), variables, and basic syntax — all running directly in your browser.

beginner20m460

Python Variables and Data Types: A Practical Introduction

Master Python variables, data types (int, float, str, bool, None), type checking, and type conversion with hands-on examples and exercises.

beginner25m695

Python Numbers: Integers, Floats, and Math You\

Master Python integers, floats, and arithmetic operators. Learn math operations, number conversion, rounding, and real-world calculations with interactive examples.

beginner20m6110

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

Learn how to create, access, slice, and manipulate strings in Python. Master indexing, slicing, concatenation, and common string operations with interactive examples.

beginner25m7135

Every Python String Method Explained with Examples

Master Python string methods: upper(), lower(), strip(), split(), join(), replace(), find(), and more. Interactive examples and exercises for every method.

beginner25m6100

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

Master Python string formatting with f-strings, .format(), and the % operator. Learn number formatting, alignment, and real-world formatting patterns.

beginner20m575

Python Booleans, Comparisons, and All Operators Explained

Master Python booleans, comparison operators, logical operators (and, or, not), truthiness, and operator precedence with interactive examples.

beginner25m690

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

Master Python print() with sep, end, and formatting. Understand input() for user interaction. Learn output patterns used in real programs.

beginner15m490

Python Type Conversion: How to Convert Between Data Types

Learn implicit and explicit type conversion in Python. Master int(), float(), str(), bool() and avoid common conversion errors.

beginner20m585

Writing Clean Python: Comments, Docstrings, and PEP 8

Learn to write clean, readable Python code. Master comments, docstrings, naming conventions, and PEP 8 style guidelines that professional developers follow.

beginner15m490