Unit 1, Lesson 3
Topic | Description | Link |
---|---|---|
Lesson | Two-part lesson, outlined below | Part One, Part Two |
Source Materials | Original files used to create this lesson | Here |
This material may be challenging to get through if students are new to programming. Expect students to struggle with for loops and functions — you likely will have to do these exercises as a code-along. If time is left over, there is practice on the Coffee Preferences data set. If not, students can use it for more practice at home.
- Discuss Python as a programming language.
- Define integers, strings, tuples, lists, and dictionaries.
- Demonstrate arithmetic operations and string operations.
- Demonstrate variable assignment.
- Define
Python
control flow and conditional programming. - Implement
for
andwhile
loops to iterate through data structures. - Apply
if, else
conditional statements. - Create functions to perform repetitive actions.
- Demonstrate error handling using
try, except
statements. - Use
Python
control flow and functions to help us parse, clean, edit and analyze data sets.
Part 1 : Python Data Types (90 min)
- Why Python? (5 min)
- Introduction to Data Types (10 min)
- Jupyter Notebook (5 min)
- Python Variables (5 min)
- Operators (10 min)
- Integers and Floats (5 min)
- Strings (10 min)
- Lists (10 min)
- Tuples (5 min)
- Dictionaries (10 min)
- Importing Packages and Documentation (5 min)
- Practice With a Partner (10 min)
Part 2 : Python Iterations, Control Flow, and Functions (80 min)
- If... Else Statements (10 min)
- Iterating With For Loops (30 min — consider mostly doing as a code-along)
- Functions (30 min — consider mostly doing as a code-along)
- While Loops (10 min)
- Practice control flow on Coffee Preference data set (if time remains, otherwise practice at home)
- Conclusion
Before this lesson(s), students should already be able to:
- Recall and define common Python data types.
For more information on this topic, check out the following resources: