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 156 of 179Python str.capitalize(): Syntax, Behavior, and Edge Cases
An in-depth look at Python's str.capitalize() method: how it handles non-letter first characters, Unicode edge cases, and where it differs from title(), upper(), and casefold().
Python String Upper: Syntax, Unicode, and Pitfalls
Learn how Python's str.upper() method converts strings to uppercase, including Unicode behavior, locale considerations, performance notes, and common pitfalls.
Python str.lower(): Syntax, Unicode, and Performance
Learn how Python's str.lower() method converts text to lowercase, how its Unicode handling differs from str.casefold(), and what to consider when lowercasing strings in Python.
Python strip vs lstrip vs rstrip: When to Use Each
Understand when to use Python's strip, lstrip, and rstrip methods, including default whitespace handling, custom character removal, and edge cases.
Python rstrip(): Removing Trailing Whitespace and Characters
Learn how Python's rstrip() method removes trailing whitespace and specific characters from strings, with practical examples and common pitfalls.
Python lstrip: Removing Leading Characters from Strings
python lstrip: Learn how Python's lstrip() removes leading whitespace or character sets, how it differs from strip() and rstrip(), and where it commonly fails.
Python String strip() Method: Syntax, Examples, and Pitfalls
python string strip: Learn how Python's strip() method removes leading and trailing whitespace or custom characters, with syntax, examples, and common pitfalls.
Python String Join: Syntax and Examples
Learn how to use Python's string join() method to concatenate iterables into a single string, with syntax, examples, and common mistakes to avoid.
Python String splitlines: How to Split on Line Breaks
python string splitlines: Learn how Python's str.splitlines() splits strings at line boundaries, handles universal newlines, and differs from split() - with practical...
Python String rsplit: Splitting from the Right
Learn how Python's rsplit method splits strings from the right, including its maxsplit parameter, edge cases, and when to choose it over split.