Python Data Types Explained
Learn every built-in Python data type including numbers, strings, booleans, collections, and None. Understand which type to use and why types matter.
Learn Python programming from scratch
Learn every built-in Python data type including numbers, strings, booleans, collections, and None. Understand which type to use and why types matter.
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 the most useful Python string methods including count(), find() variants, partition(), translate(), and classification methods like isalpha() and isdigit().
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 how to create, access, and modify nested lists in Python. Build grids and matrices, and understand how shallow copies affect multi-dimensional data.
Master Python list comprehensions to create, filter, and transform lists in a single line. Learn the syntax, common patterns, and when to use a regular loop instead.
Learn what Python tuples are, how they differ from lists, when to use them, and why immutability makes tuples the right choice for fixed collections of data.
Learn tuple packing and unpacking in Python. Master multiple assignment, swapping variables, star expressions for extended unpacking, and using unpacking in loops.