1. Engineering
  2. Computer Science
  3. python copy the following dictionary into a code cell lasteruption...

Question: python copy the following dictionary into a code cell lasteruption...

Question details

python

  • Copy the following dictionary into a code cell:

    lastEruption = {"Mt.Etna": 2017, "Mt. St. Helens" :1980, "Mt. Erebus": 2017, "Mount Teide" : 1909, "Mt. Hood": 1800}

  • Define an anonymous function active that returns a boolean. It should return True if a volcano has erupted in the last 5 years

  • use the function filter( ), the function active, and the dictionary of volcanoes to determine which volcanoes have erupted in the last 5 years.
  • Print the names of the recently active volcanoes
Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution