If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Challenge: 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, increment footprint by another 10.

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!

Code editor

Code files

Output