Path: blob/master/lessons/lesson_02/code/python-foundations/README.md
1904 views
Python Foundations
Unit 1: Required
Materials We Provide
Topic | Description | Link |
---|---|---|
Lesson | (Beginner) Part 1: Data Types | Part One |
Lesson | (Intermediate) Part 2: Control Flow | Part Two |
Practice | Practice: Part 1: Data Types | here |
Practice: Part 2: Functions | here | |
(Intermediate, Bonus) Practice: IMDB Intro Lab | here | |
Solutions | Sample Solutions for Blanked Out Lesson Demo | Data Types |
Sample Solutions: Part 1, Practice | Practice: Data Types | |
Sample Solutions: Part 2, Practice | Practice: Functions | |
Sample Solutions: Bonus Lab | IMDB Lab | |
Source Materials | Original files used to create this lesson | Here |
Learning Objectives
By the end of this lesson, students will be able to:
Part 1: Python Data Types
Discuss Python as a programming language.
Define integers, strings, tuples, lists, and dictionaries.
Demonstrate arithmetic operations and string operations.
Demonstrate variable assignment.
Part 2: Python Iteration, Control Flows, and Functions
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.
Student Requirements
Before this lesson(s), students should already be able to:
Recall and define common Python data types.
Lesson Outline
Instructor Note: 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.
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
Additional Resources
For more information on this topic, check out the following resources: