Compare Values and Data Types in Python
Learn how to compare values in Python using comparison operators, chained comparisons, and how different data types behave when compared to each other.
Learn Python programming from scratch
Learn how to compare values in Python using comparison operators, chained comparisons, and how different data types behave when compared to each other.
Learn what a Python string is, how strings store text as Unicode code points, and why strings are the most used data type in real Python programs.
Learn every way to create a Python string using single quotes, double quotes, triple quotes, the str() constructor, and implicit concatenation.
Learn how to access individual characters in Python strings using zero-based indexing, negative indices, and the len() function to avoid IndexError.
Learn how to extract substrings from Python strings using slice notation with start, stop, and step parameters. Master the most powerful string operation.
Learn the most frequently used Python string operations including concatenation, repetition, membership testing, and length checking with practical examples.
Learn how to use Python f-strings to embed expressions directly inside string literals for clean, fast, and readable string formatting.
Learn how to use escape characters in Python strings to include quotes, newlines, tabs, backslashes, and Unicode characters that cannot be typed directly.
Learn how to create multiline strings in Python using triple quotes, how Python handles line breaks, and when to use multiline strings for docstrings and text blocks.
Learn how to split strings into lists and join lists into strings using Python's split() and join() methods with practical examples.
Learn how to change string case in Python using lower(), upper(), capitalize(), title(), swapcase(), and casefold() with practical examples.
Learn how Unicode works in Python strings, how to encode text to bytes and decode bytes back to text, and how to handle encoding errors gracefully.