<!--
title: Unit 5 Lab: Finalizing the Movie App
type: Lab
duration: "01:35"
creator: Susi Remondi
-->

## ![](https://s3.amazonaws.com/python-ga/images/GA_Cog_Medium_White_RGB.png)  {.separator}

<h1>Unit 5 Lab: Finalizing the Movie App</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, make sure they can access the lab doc, and be available in case of questions; at the end, go over the solution (located in the `solution-code` folder).


## Learning Objectives
In this lesson, students will:
- Apply what they've learned in Unit 5 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.
- Change the location of the starter code and lab directions.

## In Class: Materials
- Projector
- Internet connection
- Python 3.0
- Lab directions

-->

---

## Lesson Objectives

- Apply what you’ve learned in Unit 5 to create a working Python program.
- Wrap up Unit 5.
- Q&A and transition.


<aside class="notes">

**Talking Points:**

- Congratulate the class on finishing Unit 5!

</aside>

---

## You Do: Unit 5 Lab — Intermediate Python

Do you remember the last unit lab? You added error-checking, string formatting, and a `while` loop (but not an infinite one!) — slightly restructuring the code as you went.

In this lab, you'll finish the movie app we've been working toward! You'll add an API call to actually get the Rotten Tomatoes rating, prompt a user for whether they want to search for a movie or view a rating, and read in an API key from a file.

**Open the file [`Unit Lab 5 Directions`](25-unit-lab-5/unit-lab-5-directions) to see the lab and its instructions. Follow the instructions there.**

- *If your solution to the last lab didn't quite work, there's working code provided in the [`starter-code`](25-unit-lab-5/starter-code/movie_app.py) folder. Copy that to your local folder and work from there.*

Try your best! Raise your hand if you really need help.


<aside class="notes">

115 MINUTES

**Teaching Tips:**

- Make sure you change the link or point out what PDF to refer to, 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 that, throughout the course, there's a lab at the end of each unit. Each lab builds upon the last.
- Does anyone need help with the starter code?

</aside>

--

## Debrief: Unit 4 Lab — Carefully Adding a Bit More Logic

How did it go?

Let's go over it.

Make sure you understand and your code works — the Unit 5 lab builds off of this one!

<aside class="notes">

**Talking Points:**

- Bring up the solution (located in the `solution-code` directory) and walk them through it. Make sure everyone understands — and that everyone's code is accurate or knows that it isn't.

</aside>

---

## Unit 5 Wrap-Up

What did we cover?

Scripting:

* Write scripts that perform file I/O.
* Write scripts that take user input.

Code abstraction:

* Use `itertools` to implement efficient looping.
* Use list comprehensions to concisely create lists.

---

## Unit 5 Wrap-Up

Modules:

* Add packages and modules to a Python program.
* Navigate library documentation.

APIs:

- Describe what an API is and why we might use one.
- Call an API.

Questions?

<aside class="notes">

5 MINUTES

**Teaching Tips:**
- Briefly review the high-level learning objectives for Unit 5.
- As you read each bullet aloud, ask students to give you a "fist to five." See **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 that the majority of the class is uncomfortable with.
- Take time to go over questions (but remember the parking lot).

**Talking Points**:
- Wow, we've covered a lot! Let's take a minute to review what we've learned so far.
- I'm going to read through the topics for Unit 5. 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>
