Python Data Types Explained
Learn every built-in Python data type including numbers, strings, booleans, collections, and None. Understand which type to use and why types matter.
Learn Python programming from scratch
Learn every built-in Python data type including numbers, strings, booleans, collections, and None. Understand which type to use and why types matter.
Learn how Python integers work, including unlimited precision, arithmetic operations, integer literals in different bases, and common integer methods.
Learn how Python floats work with IEEE 754 double precision, why 0.1 + 0.2 is not exactly 0.3, and how to handle floating-point arithmetic correctly.
Learn how Python booleans work as a subclass of integers, how truthiness evaluates any value, and how to use boolean logic in conditions and expressions.
Learn how Python's None singleton represents the absence of a value, when to use None as a default, and how to check for None correctly with the is operator.
Learn every way to create a Python string using single quotes, double quotes, triple quotes, the str() constructor, and implicit concatenation.
Learn how to format strings in Python using the str.format() method, positional and keyword placeholders, and the format specification mini-language.
Learn how to use Python f-strings to embed expressions directly inside string literals for clean, fast, and readable string formatting.
Learn how to use escape characters in Python strings to include quotes, newlines, tabs, backslashes, and Unicode characters that cannot be typed directly.
Learn how to search and replace text in Python strings using find(), index(), replace(), startswith(), endswith(), and the in operator.
Learn how to change string case in Python using lower(), upper(), capitalize(), title(), swapcase(), and casefold() with practical examples.
Learn how to compare strings in Python using equality, ordering operators, and case-insensitive comparison with practical examples and Unicode-aware techniques.