|
|
<!--
|
|
|
title: Intro to Programming With Variables
|
|
|
type: lesson
|
|
|
duration: "01:00"
|
|
|
creator: Brandi Butler [partially originating from Steve Peter's Cybersecurity lesson]
|
|
|
Private gist location: https://gist.github.com/brandiw/a55863eea158b759fe8ada94c730a2a6
|
|
|
Presentation URL: https://presentations.generalassemb.ly/a55863eea158b759fe8ada94c730a2a6#/
|
|
|
-->
|
|
|
|
|
|
##  {.separator}
|
|
|
|
|
|
<h1>Unit 3 Lab: Object-Oriented Programming</h1>
|
|
|
<!--
|
|
|
|
|
|
## Overview
|
|
|
This lesson consists of a hands-on lab during which learners will independently create a working Python program. This lab builds on the previous lab, so starter code (which is the same solution code as the previous lab) is provided for them. You simply need to introduce the lab, make sure they have working starter code and that they can access the lab doc, and be available in case of questions. At the end, go over the solution (in the `solution-code` folder).
|
|
|
|
|
|
## Learning Objectives
|
|
|
In this lesson, students will:
|
|
|
- Apply what they've learned in Unit 3 to create a working Python program.
|
|
|
|
|
|
## Duration
|
|
|
90 minutes
|
|
|
|
|
|
## Suggested Agenda
|
|
|
|
|
|
| Time | Activity |
|
|
|
| --- | --- |
|
|
|
| 0:00 - 0:05 | Welcome / Set-Up |
|
|
|
| 0:05 - 1:20 | Work Time |
|
|
|
| 1:20 - 1:30 | Q&A + Close |
|
|
|
|
|
|
## Before Class: Preparation
|
|
|
- Before class, complete the lab yourself to ensure you’re familiar with the solution, as well as the various challenges learners might encounter.
|
|
|
|
|
|
## In Class: Materials
|
|
|
- Projector
|
|
|
- Internet connection
|
|
|
- Python 3
|
|
|
- Lab directions
|
|
|
|
|
|
-->
|
|
|
|
|
|
---
|
|
|
|
|
|
## Lesson Objectives
|
|
|
|
|
|
- Apply what you’ve learned in Unit 3 to create a working Python program.
|
|
|
- Wrap up Unit 3.
|
|
|
- Q&A and transition.
|
|
|
|
|
|
|
|
|
<aside class="notes">
|
|
|
|
|
|
**Talking Points:**
|
|
|
|
|
|
- Congratulate students on finishing Unit 3!
|
|
|
</aside>
|
|
|
|
|
|
---
|
|
|
|
|
|
## You Do: Unit 3 Lab — Object-Oriented Programming
|
|
|
|
|
|
You already have an app that, depending on a variable's value, prints either a movie rating, title, or both.
|
|
|
|
|
|
In today’s lab, you will add structure to your movie app using dictionaries and classes.
|
|
|
|
|
|
**Open the file [`unit-lab-3-directions`](unit-lab-3-directions.md) to see the lab and its instructions. Follow the instructions there.**
|
|
|
|
|
|
Try your best! Raise your hand if you really need help.
|
|
|
|
|
|
|
|
|
<aside class="notes">
|
|
|
|
|
|
75 minutes
|
|
|
|
|
|
**Teaching Tips:**
|
|
|
|
|
|
- Make sure you change the link or point out what PDF to look at, and check the starter code location.
|
|
|
- Make sure all students start with working code — they can get it from the starter code file.
|
|
|
- The lab has instructions and an explanation in it for them to read. Make sure they're all opening the lab instructions OK.
|
|
|
- Stay on this slide until everyone's done or time's up!
|
|
|
|
|
|
**Talking Points:**
|
|
|
|
|
|
- Remember, throughout the course, there is a lab at the end of each unit. Each lab builds upon the last.
|
|
|
- Does anyone need help with the starter code?
|
|
|
- Right now, let's set up the functions and control flow to print out the values of our variables.
|
|
|
</aside>
|
|
|
|
|
|
---
|
|
|
|
|
|
## Debrief: Unit 3 Lab — Object-Oriented Programming
|
|
|
|
|
|
How did it go?
|
|
|
|
|
|
Let's go over it.
|
|
|
|
|
|
Make sure you understand and your code works — the Unit 4 lab builds off this one!
|
|
|
|
|
|
<aside class="notes">
|
|
|
|
|
|
**Talking Points:**
|
|
|
|
|
|
- Bring up the solution (in the `solution-code` directory) and walk learners through it. Make sure everyone understands — and that their code is accurate or they know that it isn't.
|
|
|
- The next lab builds off of this one but provides starter code if needed.
|
|
|
</aside>
|
|
|
|
|
|
---
|
|
|
|
|
|
## Unit 3 Wrap-Up
|
|
|
|
|
|
What can you do?
|
|
|
|
|
|
- Build dictionaries.
|
|
|
- Perform common actions with sets.
|
|
|
- Perform common actions with tuples.
|
|
|
- Identify when to use which data structure.
|
|
|
- Define a class and instantiate an object.
|
|
|
- Implement inheritance.
|
|
|
- Overwrite variables and methods.
|
|
|
|
|
|
Questions?
|
|
|
|
|
|
<aside class="notes">
|
|
|
|
|
|
5 minutes
|
|
|
|
|
|
**Teaching Tips:**
|
|
|
|
|
|
- Briefly review the high-level learning objectives for Unit 3.
|
|
|
- As you read each bullet aloud, ask students to give you a "fist to five." See the **Talking Points** below.
|
|
|
- Observe student votes for each item, and make a mental note to follow up with individuals who are not feeling confident, or find time to reteach topics with which the majority of the class is uncomfortable.
|
|
|
- Take time to go over questions (but remember the parking lot).
|
|
|
|
|
|
**Talking Points:**
|
|
|
|
|
|
- Wow, we've covered a lot, and we're just getting started! Let's take a minute to review what we've learned so far.
|
|
|
- I'm going to read through the learning objectives for Unit 3. As I do so, I want you to tell me how confident you feel that you've mastered each one, on a scale of 0 to 5.
|
|
|
* Hold up your fist to indicate 0 — you don't feel confident at all that you mastered this objective.
|
|
|
* Hold up all five fingers to indicate 5 — you feel super confident. You're an expert!
|
|
|
</aside>
|