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 169 of 179Python Arithmetic Operators: Syntax and Behavior
A practical reference to Python's arithmetic operators, covering true vs floor division, modulo with negatives, precedence, type coercion, and common pitfalls.
Handling Python Type Conversion Errors
A practical guide to Python type conversion errors: how to distinguish TypeError from ValueError, handle common edge cases, and write robust conversion helpers.
Python Bytes Conversion: Encoding, Decoding, and More
Learn how to encode strings to bytes, decode bytes to text, convert bytes to integers and hex, and handle encoding errors with clear Python examples.
Python Dict Conversion: Objects, JSON, and Type Casting
Learn how to convert Python dicts to objects, JSON strings, and typed values, including nested structures, custom encoders, and common failure handling.
Python Set Conversion: Lists, Tuples, and Casting
Python set conversion explained: convert lists, tuples, and strings to sets, cast element types with comprehensions, and understand hashability constraints.
Python Tuple Conversion: Lists, Sets, Dictionaries
Learn how to convert Python tuples to lists, sets, dictionaries, and strings, and back to tuples, with clear examples and performance tradeoffs.
Python List Conversion: Convert Data Types to Lists
Practical python list conversion: converting tuples, strings, sets, generators, and ranges into lists, plus element type conversion and memory tradeoffs.
Python String Conversion: str(), repr(), and Formatting
Understand how Python objects become strings with str(), repr(), f-strings, and format(). See the differences and how to control output.
Python Float Conversion: Handling Strings and Edge Cases
Learn how to safely convert strings, ints, and other types to float in Python, handle errors, and avoid precision pitfalls.
Python Casting: Explicit Type Conversion Explained
Learn how Python casting works: explicit conversion with built-in functions, implicit coercion, container conversions, and common pitfalls.