Python Variables Explained
Understand what Python variables are, how they store and reference data, and why Python's variable model is different from other programming languages.
Learn Python programming from scratch
Understand what Python variables are, how they store and reference data, and why Python's variable model is different from other programming languages.
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 how Python's built-in complex number type represents values with real and imaginary parts, how to perform arithmetic, and when to use the cmath module.
Learn the critical difference between immutable and mutable types in Python, which types belong to each category, and how mutability affects your code.
Learn how to check the type of any Python value using the type() built-in function, the isinstance() function for flexible checks, and when to use each approach.
Learn how to convert between Python data types using built-in constructor functions like int(), float(), str(), list(), and dict(). Master safe type conversion patterns.
Learn the difference between implicit type conversion Python handles automatically and explicit type conversion you write yourself. Understand coercion rules and safe conversion patterns.
Learn how to compare values in Python using comparison operators, chained comparisons, and how different data types behave when compared to each other.
Learn every way to create a Python string using single quotes, double quotes, triple quotes, the str() constructor, and implicit concatenation.