Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

bulbasaur,grass,South America ivysaur.grass.Asia.Antarctica venusaur.grass.Africa,South America charmander.fire.North America,Oceania charmeleon,fire.South America charizard,fire,Oceania war e ,water,Antarctica blastoise.water.Africa,South. America caterpie,bug,0ceania metapod.bug.Asia.Af.rica.Europe, outh. America butterfree,bug,Antarctica,Oceania,South America weedle,bug,Europe,South America,Asia kakuna,bug,South America,Oceania,Africa,North

image text in transcribedimage text in transcribedimage text in transcribed

bulbasaur,grass,South America ivysaur.grass.Asia.Antarctica venusaur.grass.Africa,South America charmander.fire.North America,Oceania charmeleon,fire.South America charizard,fire,Oceania war e ,water,Antarctica blastoise.water.Africa,South. America caterpie,bug,0ceania metapod.bug.Asia.Af.rica.Europe, outh. America butterfree,bug,Antarctica,Oceania,South America weedle,bug,Europe,South America,Asia kakuna,bug,South America,Oceania,Africa,North America beedrill,bug,North America, Asia,Oceania,Antarctica pidgey,flying,Antarctica, Europe,Oceania, South America Ridgeotto.fling.Europe,..sia pidgeot.flying.Europe,Oceania,Asia rattata.normal,South. America, Europe, Antarctica raticate,normal,Oceania spearow.flying,South. America,North America, Antarctica, Europe ekans,poison,Europe,0ceania,North America, Asia arbok,poison,South America pikachu,electric,North America,Oceania,Africa raichu,electric,North America sandshrew,around,Asia,North America, South America sandslash,around,Asia,South America,North America nidoranfemale,poison,Asia Write a function called find_continents which takes as parameter(s): A dictionary in the format of the pokemon database as described in Q1 This function should construct and return a list of all the different continents where it is possible to find pokemon. Each entry in the list should be unique: in other words, don't add the same continent twice even if you can find multiple kinds of pokemon there. For the input file you were given, the resulting list should be (though not necessarily in this order) ['0ceania', 'Asia', 'South America', 'North America', 'Africa', Antarctica', 'Europe'] Also, note that this function must not change the pokemon database in any way. def read_pokedata(fname): param fname: a string indicating the location of pokemon data return: a database that stores all data with open(fname) as f for rec in f.readlines) rec rec.strip).split("," key rec te] d[key] rec[1:] return d

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Why do firms use event sponsorship?

Answered: 1 week ago