A reading covering Python control flow and data structures—including conditional statements (if/elif/else), loops, and related constructs—that learners read to understand how programs make decisions and how instructors can use it as a reference text for introducing branching logic in Python.
Topics
This module covers 8 topics. Open a topic to see its subtopics.
Module Content
15 items.
-
-
An interactive reading module covering Python control flow with if, elif, and else conditional statements, explaining Boolean evaluation and branching logic; learners read through explanations and examples to understand how programs make decisions.
-
An interactive reading module introducing Python lists as a core data structure, covering how to create, access, and manipulate ordered collections using square-bracket syntax; learners read through explanations and examples to build foundational knowledge of list operations.
-
A lesson page explaining how Python's if, elif, and else statements let a program test a condition and choose which block of code to run, used as the introductory reading on decision-making in code.
-
A lesson page on for loops and the range() function, showing how to iterate over strings, lists, and generated number sequences to repeat calculations instead of writing them out, with engineering-flavored examples.
-
A lesson page on while loops that explains repeating code while a condition stays True and when to prefer this over a for loop, using cases like reading sensors until a threshold, validating user input, and iterative numerical refinement.
-
A lesson page introducing the break and continue keywords for exiting a loop early or skipping a single iteration, used to learn finer control over loop execution when searching data or skipping bad values.
-
A lesson page on Python lists as ordered, mutable sequences, covering indexing, modifying, adding, and removing items, with engineering applications such as storing series of sensor readings or measurements.
-
A lesson page on tuples as ordered but immutable sequences, contrasting them with lists and showing indexing and slicing plus when fixed collections like coordinates or material properties are appropriate.
-
A lesson page on dictionaries, explaining key-value storage, creating dictionaries with curly braces, accessing values by key, and adding, updating, or removing entries for fast labeled data lookup.
-
A lesson page introducing sets as unordered collections of unique elements with fast membership testing and mathematical set operations, concluding with guidance on choosing among lists, tuples, dictionaries, and sets.
-
A consolidated, single-page compilation of all Module 2 readings — conditionals, for and while loops, break/continue, and lists, tuples, dictionaries, and sets — useful for continuous reading, printing, or review.
-
A 10-question quiz bank assessing learners' understanding of conditional statements, the elif clause, the range() function, loop selection, and break behavior in nested loops, used to test comprehension of core control flow concepts.
-
An interactive drag-and-drop activity covering nested conditionals in which learners match 8 code snippets or keywords to their correct descriptions, with correct answers locking in place and incorrect ones bouncing back, used to reinforce understanding of nested conditional syntax and logic.
-
An interactive drag-and-drop activity in which learners match Python data structure names (e.g., list, tuple, dictionary) to 8 engineering scenarios that best illustrate their use, used to practice selecting the appropriate data structure for real-world engineering contexts.