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 170 of 179Python Implicit Type Conversion Explained
python implicit type conversion: Learn how Python performs implicit type conversion, where it applies, and how to avoid common pitfalls in arithmetic, comparisons, and...
Python Explicit Type Conversion: int(), float(), str()
Practical guide to Python explicit type conversion with int(), float(), and str(), including edge cases and error handling.
Python Type Conversion: Implicit vs Explicit
Learn the difference between implicit and explicit type conversion in Python, when to use built-in functions like int(), str(), and list(), and how to avoid common conversion pitfalls.
Python Boolean Expression: Truthiness and Operators
Understand Python boolean expressions: truthiness, and/or/not operators, short-circuiting, operator precedence, and common pitfalls.
Python Short Circuit Evaluation Explained
Learn how Python's short-circuit evaluation works with `and` and `or`, including operand return values, common use cases, and pitfalls.
Python or vs |: Logical vs Bitwise
python or vs |: Understand the difference between Python's `or` logical operator and the `|` bitwise operator, including type unions and common pitfalls.
Python and vs &: Logical and Bitwise Operators
python and vs &: Explains the difference between Python's `and` and `&` operators, covering precedence, short-circuiting, and common mistakes.
Python Not Operator: Usage and Pitfalls
Understand how Python's not operator works: truthiness rules, operator precedence, and common mistakes to avoid when writing boolean logic.
Python or Operator: How It Really Works
Learn how Python's or operator returns one of its operands instead of a boolean, how truthiness drives the result, and why falsy values can cause surprising fallback behavior.
Python and Operator: Syntax, Short-Circuiting, and Precedence
Understand how Python's `and` operator evaluates expressions, short-circuits, and interacts with precedence to write clearer, more efficient conditions.