==================================================== L3: Python Fundamentals — Part II ==================================================== Overview -------- This lecture covers Python's essential data structures and control flow mechanisms: loops with ``for`` and ``while``, the versatile ``range()`` function, and the four fundamental collection types — lists, tuples, dictionaries, and sets. You will learn iteration patterns, list comprehensions, and how to choose the right data structure for different tasks. .. admonition:: Learning Objectives :class: learning-objectives By the end of this lecture, you will be able to: - Write loops using ``for`` and ``while`` statements with ``break``, ``continue``, and ``else``. - Master the ``range()`` function and its memory-efficient properties. - Understand iterables and distinguish between in-place and out-of-place operations. - Create, modify, and iterate over lists using methods and comprehensions. - Work with tuples, understand immutability, and apply tuple unpacking. - Implement dictionaries for key-value storage and iteration. - Use sets for unique collection management and mathematical set operations. .. toctree:: :maxdepth: 2 :titlesonly: :hidden: l3_lecture l3_exercises l3_quiz l3_references Next Steps ---------- - In the next lecture, we will cover Functions: - Defining and calling functions - Parameters and arguments - Return values - Scope and namespaces - Type hints - Docstrings - Review and experiment with all code snippets and exercises from today's lecture. - Practice using lists, dictionaries, and loops together. - Start reading `Python Official Tutorial `_ — Sections 4 and 5.