2 - Control Flow and Python Data Structures — Topics & Learning Outcomes

📋 Module Topics🎯 Student Learning Outcomes

Module Topics

Conditional Statements

Conditional statements allow a program to make decisions by executing different code blocks based on whether a condition evaluates to true or false. This topic covers if, elif, and else constructs in Python.

for Loops and the range() Function

The for loop iterates over a sequence of items, making it ideal for processing collections of data. The range() function generates numeric sequences commonly used to control loop iterations.

while Loops

A while loop repeats a block of code for as long as a specified condition remains True, making it suitable for situations where the number of iterations is not known in advance.

Loop Control: break and continue

The break and continue statements provide fine-grained control over loop execution, allowing early termination or skipping specific iterations without exiting the loop entirely.

Lists

Lists are ordered, mutable sequences that can hold items of any type, making them one of the most versatile and widely used data structures in Python.

Tuples

Tuples are ordered, immutable sequences that are ideal for storing fixed collections of data that should not be changed after creation.

Dictionaries

Dictionaries store data as key-value pairs, enabling fast lookups by key rather than by position, and are ideal for representing structured, labeled data.

Sets and Choosing the Right Data Structure

Sets store unique, unordered elements and support efficient membership testing and set operations. This topic also provides guidance on selecting the appropriate data structure for engineering problems.

Student Learning Outcomes

By the end of this module, students will be able to:

MO1
Construct conditional statements using if, elif, and else clauses — combined with comparison and logical operators — to control program execution flow
Level: ApplyType: CognitiveCourse mapping: CO3
MO2
Implement for loops, while loops, and loop control statements (break and continue) to iterate over sequences and numeric ranges in engineering contexts
Level: ApplyType: CognitiveCourse mapping: CO3
MO3
Manipulate Python lists using indexing, slicing, list comprehensions, and built-in methods to process ordered collections of data
Level: ApplyType: CognitiveCourse mapping: CO1
MO4
Differentiate between lists, tuples, dictionaries, and sets based on their properties of mutability, ordering, and access method
Level: AnalyzeType: CognitiveCourse mapping: CO1
MO5
Select the appropriate Python data structure for a given engineering problem by evaluating the correctness, performance, and readability trade-offs among lists, tuples, dictionaries, and sets
Level: EvaluateType: CognitiveCourse mapping: CO1

Course Outcomes (reference)

CO1Use variables, arrays and object structures appropriate to solve engineering problems.
CO2Write computer functions to meet specific calculation needs.
CO3Write computer programs to solve mathematical expressions and engineering problems