Main content
Course: Intro to computer science - Python > Unit 2
Lesson 4: Nested conditionalsChallenge: Environmental footprint
Instructions
Step 1
Measure pet footprints
Malika is designing an environmental footprint algorithm to measure the impact a person has on the environment.
Malika's cat eats mostly chicken and fish, but Emma’s pet rabbit eats mostly hay and lettuce. After some research, Malika determines that a pet’s diet is a major factor in its environmental impact.
- If the user has a pet, use the
input()
function to ask if their pet’s food contains meat. - If they enter
yes
, incrementfootprint
by another10
.
If the user doesn’t have a pet, make sure you don’t ask the follow-up pet food question. Think carefully about your indentation!