Python guides
Every published Python guide, newest first, with practical examples you can copy into your own project.
3,965 guides across 14 topics
Topics
Popular Python guides
Most readLatest Python guides
Page 171 of 179Python bool int Relationship: Subclass and Pitfalls
Understand how Python's bool, a subclass of int, affects truthiness, arithmetic, comparisons, and type checks, and learn to avoid common pitfalls.
Python Bool Conversion: Truthiness and bool()
Understand how Python converts values to booleans: truthiness rules, explicit bool() calls, string parsing gotchas, and common pitfalls.
Python Truth Value Testing Explained
Learn how Python decides whether an object is true or false in boolean contexts, and how to define __bool__ and __len__ to control that behavior.
Python Truthy and Falsy Values Explained
Learn what truthy and falsy mean in Python, see which standard values are falsy in Boolean contexts, and how to use truthiness in conditionals and custom classes.
Python Boolean Values: Truthiness and Operators
python boolean values: Learn how Python boolean values work: True/False, truthiness rules, boolean operators, and common pitfalls in real code.
Python Bool Usage: Truthiness and Boolean Logic
Learn how Python's bool type and truthiness rules affect conditionals, loops, and comparisons, with practical patterns for cleaner code.
Python Complex Number Operations: Syntax and Practical Use
Learn how to create, manipulate, and format complex numbers in Python, including arithmetic, cmath functions, comparison limits, common mistakes, and performance considerations.
Python Complex Numbers: Accessing Real and Imaginary Parts
Learn how to access the real and imaginary parts of Python complex numbers using .real and .imag, with practical examples and edge cases.
Python Complex Numbers: Syntax, Operations, and the cmath Module
python complex numbers: Learn how Python represents complex numbers, performs arithmetic, and uses the cmath module for advanced math functions with practical examples.
Python Decimal vs Float: Choosing the Right Numeric Type
Compare Python's float and Decimal types. Learn why binary floating point shows values like 0.30000000000000004, how Decimal controls rounding, and when to choose each.