Main content
Course: Intro to computer science - Python?>?Unit 2
Lesson 1: Boolean conditionsChallenge: Recycling sort
Instructions
Step 1
Recycle plastic
Sefa started a recycling service at his school. To help it succeed, he’s building an app where students can enter information about an item, and then the app tells them whether it belongs in the trash or in the recycling. Sefa wants to start the service by recycling plastic.
- Add a conditional that sets
waste_type
to the value"recycling"
if the item is plastic.
An item is plastic if the variable material
contains the value "plastic"
. For all other materials, waste_type
should contain "trash"
.