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 127 of 179Python chr Function: Converting Integers to Characters
Learn how to use Python's chr() function to convert integers to Unicode characters, handle errors, and avoid common pitfalls.
Python ord Function: Character to Integer
Use Python's built-in ord() function to convert single characters to Unicode code points, avoid common errors, and see practical examples.
Python ascii() Function: Escaping Non-ASCII Characters
Learn how Python's ascii() function converts objects to ASCII-safe printable strings, escapes Unicode characters, and differs from repr().
Python repr Function: How It Works and When to Use It
Python's repr() returns unambiguous string representations. See how to override __repr__ in your classes and when to use repr() instead of str().
Python Hash Function: Usage and Customization
Understand Python's hash() function, its role in dicts and sets, and how to implement custom __hash__ and __eq__ correctly.
Understanding Python's id() Function
python id function: Explore how Python's id() function returns object identity, how CPython assigns memory addresses, and when relying on id() is safe or misleading.
What Makes an Object Callable in Python
Learn what makes an object callable in Python, how callable() works, and when implementing __call__ creates a useful callable object.
Python all() Function: Syntax, Usage, and Edge Cases
Learn how Python's all() function works, its syntax, behavior on empty iterables, and practical usage with generator expressions.
Python any() Function: Behavior, Use Cases, and Pitfalls
Python's any() function returns True if any element in an iterable is truthy. Learn how truthiness, short-circuiting, and generator expressions fit into validation code and common pitfalls.
Python filter function: syntax and usage
python filter function: Learn how the Python filter function works, its syntax, and when to use it over list comprehensions, with practical examples.