Creating Strings in Python
Learn every way to create a Python string using single quotes, double quotes, triple quotes, the str() constructor, and implicit concatenation.
Learn Python programming from scratch
Learn every way to create a Python string using single quotes, double quotes, triple quotes, the str() constructor, and implicit concatenation.
Learn the most frequently used Python string operations including concatenation, repetition, membership testing, and length checking 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.
Learn about Python's four main collection types, lists, tuples, sets, and dictionaries, and understand which one to use for any programming task.
Learn what a Python list is, how it stores ordered mutable data, and why lists are the most commonly used collection type in Python programs.
Learn every way to create a Python list and how to access individual items, slices, and nested elements using zero-based indexing.
Learn how to add, remove, and change items in a Python list using append, insert, extend, pop, remove, the del statement, and slice assignment.
Learn to sort Python lists using the sort method and the sorted function, control ascending and descending order, sort by a custom key, and reverse lists.
Learn every Python arithmetic operator, including addition, subtraction, multiplication, division, floor division, modulo, and exponentiation, with clear examples for each one.
Learn how Python determines which operator runs first when multiple operators appear in an expression, and how to use parentheses to control evaluation order safely.
Learn how Python short-circuit evaluation works with and and or operators, why it stops evaluating as soon as the result is determined, and how to use it safely.
Learn the most common Python operator mistakes including confusing assignment with equality, misreading precedence, misusing identity operators, and flawed short-circuit patterns.