Question

PYTHON 3.0 HELP!!!

Degree of Difficulty: Tricky Pokemon are fantastic creatures that can evolve into other, usually stronger, creatures. In their secret laboratory, the evil Team Rocket has been trying to evolve Pokemon in terrifying new ways! Might it now be possible for a meek Magikarp to evolve all the way into the mighty Mewtwo? Your job is to use the power of recursion to write a program to find out. For this problem you will be given a pokemon evolution book as a dictionary. The keys to this dictionary are pokemon names, and the value for each key is a list of pokemon that can be evolved into The following is a sample of what this dictionary might look like book vartortle squirtle blasts oise vartortle blast oise flare on jolteon Vaporeon In the example above, squirtle can (eventually) evolve into a blastoise by first evolving into a wartortle, but never into an eevee. On the other hand, eevee can evolve into any one of flareon, jolteon or vaporeon. Note that a pokemon that can no longer evolve might be in the book and associated with an empty list (like blastoise above) or might not be in the book at all. Either case is fine and your program needs to handle both cases correctly You are guaranteed, however, that the pokemon b will be structured such that a pokemon cannot devolve. Thus, if ook pokemon A can, ther directly or indirectly, evolve into pokemon B, then it will not be possible for B to evolve back into A. Your task is to write a recursive function that will answer the question of whether a source pokemon can eventually evolve into a given target pokemon. Your function should have 3 parameters: the source, the target and the pokemon dictionary to use to check for possible evolutions. Your function should return True if it is possible for source to become the target and False otherwise This might sound a little difficult, but with the power of recursion, this is not a complicated problem. Your function should be no longer than 12 lines of code not counting comments) and possibly less (ours is 8). If you find your solution is getting any longer than that, you are overthinking it! Sample Run We are providing you with 3 sample pokemon books to use; you can find these on the Moodle and you can just copy/paste the dictionary literals into your code. If you test your program with the sample code provided, you should get ouput that looks like this: Using book1 can bulbasaur evolve to venus aur? True Using book1 charmeleon evolve to blastoise? False Using book2 evolve to articuno? True Using book3 can cubone evolve to charizard? Falne Using book3 can magikarp evolve to mewtwo? True

book1 = {
    "squirtle" : ["wartortle"],
    "wartortle" : ["blastoise"],
    "blastoise" : [],
    "charmander" : ["charmeleon"],
    "charmeleon" : ["charizard"],
    "charizard" : [],
    "bulbasaur" : ["ivysaur"],
    "ivysaur" : ["venusaur"],
    "venusaur" : []
}

book2 = {
    "eevee" : ["jolteon", "flareon", "vaporeon"],
    "jolteon" : ["zapdos"],
    "vaporeon" : ["articuno"],
    "flareon" : ["moltres"]
}
book3 = {
    'cubone': ['dragonite', 'magmar', 'tangela'],
    'krabby': ['vaporeon', 'chansey', 'zapdos', 'electabuzz'],
    'spearow': ['mewtwo', 'seadra', 'tentacool'],
    'primeape': ['weepinbell', 'hitmonchan', 'mew', 'porygon', 'dewgong'],
    'snorlax': ['moltres', 'dragonair', 'dratini', 'mewtwo', 'mew'],
    'wartortle': ['rattata', 'weepinbell', 'seaking'],
    'flareon': ['porygon', 'dratini', 'articuno'],
    'clefairy': ['staryu'],
    'rattata': ['bellsprout', 'nidorino'],
    'machoke': ['staryu', 'bellsprout'],
    'vileplume': ['doduo', 'victreebel', 'machop', 'starmie', 'kabuto'],
    'dugtrio': ['golem', 'kadabra', 'rapidash', 'hitmonchan', 'aerodactyl'],
    'venusaur': [],
    'bulbasaur': [],
    'onix': ['horsea'],
    'weezing': ['snorlax'],
    'beedrill': ['grimer', 'bellsprout', 'clefable', 'arbok'],
    'butterfree': ['persian', 'dragonair', 'machop', 'starmie', 'dodrio'],
    'charmeleon': ['oddish', 'seel', 'persian', 'seaking', 'poliwrath'],
    'paras': ['seadra'],
    'raticate': ['raichu', 'voltorb', 'sandshrew'],
    'gyarados': ['articuno', 'moltres', 'flareon', 'dratini'],
    'mr.mime': [],
    'kabutops': ['dragonite', 'aerodactyl', 'mewtwo', 'dragonair'],
    'poliwhirl': ['golem', 'graveler', 'magikarp', 'electabuzz', 'mr.mime'],
    'muk': ['tauros', 'omanyte', 'mewtwo', 'electrode', 'cubone'],
    'rapidash': ['gyarados', 'electrode'],
    'golem': [],
    'rhydon': ['jynx'],
    'zapdos': ['dragonair', 'mewtwo', 'dratini'],
    'golduck': ['hypno', 'dewgong', 'jolteon', 'poliwag'],
    'gengar': ['jolteon', 'seaking', 'jynx'],
    'arcanine': [],
    'mew': [],
    'gloom': [],
    'vulpix': ['wigglytuff'],
    'articuno': ['mew', 'zapdos', 'dragonair'],
    'ponyta': ['eevee', 'tauros', 'mr.mime', 'horsea'],
    'pinsir': ['ditto', 'zapdos'],
    'grimer': ['kabutops'],
    'nidoqueen': [],
    'tangela': ['horsea', 'scyther', 'pinsir', 'kabutops', 'mewtwo'],
    'ivysaur': ['marowak', 'krabby', 'growlithe'],
    'electabuzz': ['gyarados', 'ditto', 'kabutops', 'porygon'],
    'weedle': ['raichu', 'mew', 'snorlax', 'voltorb'],
    'omanyte': ['mewtwo', 'zapdos'],
    'magnemite': [],
    'marowak': ['dratini', 'porygon', 'kabutops', 'goldeen'],
    'pidgey': [],
    'dragonair': [],
    'poliwag': [],
    'magikarp': ['articuno', 'kabutops', 'lapras', 'mew'],
    'fearow': ['omastar'],
    'slowpoke': ['koffing', 'farfetchd', 'hypno', 'krabby', 'gengar'],
    'starmie': ['dragonite', 'magikarp', 'scyther'],
    'ekans': ['slowbro', 'paras', 'electrode', 'rapidash'],
    'meowth': ['dodrio', 'poliwrath', 'ditto', 'tentacool', 'aerodactyl'],
    'raichu': [],
    'kabuto': ['aerodactyl', 'articuno', 'kabutops'],
    'charizard': [],
    'oddish': ['flareon', 'horsea', 'drowzee', 'tauros'],
    'wigglytuff': ['dragonite', 'oddish'],
    'pidgeot': ['seel', 'bellsprout'],
    'hitmonlee': ['seaking', 'mew', 'gyarados'],
    'charmander': [],
    'mewtwo': ['mew'],
    'bellsprout': ['tauros', 'gengar', 'electabuzz', 'ponyta'],
    'hypno': ['flareon'],
    'kadabra': [],
    'nidoking': ['venonat', 'muk', 'farfetchd', 'zubat', 'articuno'],
    'sandslash': ['gyarados', 'golbat', 'alakazam', 'mewtwo', 'poliwrath'],
    'diglett': ['graveler'],
    'ditto': ['kabuto', 'vaporeon', 'aerodactyl'],
    'arbok': ['horsea', 'primeape', 'hitmonlee'],
    'abra': ['grimer', 'tangela', 'dragonite'],
    'jigglypuff': [],
    'tentacool': ['weezing', 'mewtwo', 'farfetchd', 'moltres', 'grimer'],
    'tentacruel': ['dodrio'],
    'tauros': ['flareon', 'moltres', 'porygon', 'omanyte'],
    'dodrio': [],
    'exeggcute': [],
    'victreebel': ['tentacruel', 'seaking', 'ditto', 'lapras'],
    'nidoranfemale': ['jynx', 'persian', 'shellder', 'mewtwo'],
    'shellder': ['vaporeon', 'marowak', 'articuno', 'tauros', 'gyarados'],
    'nidorino': ['omanyte', 'gastly', 'magneton', 'marowak', 'paras'],
    'aerodactyl': ['zapdos'],
    'kingler': ['mew', 'cubone', 'mr.mime', 'dratini', 'weezing'],
    'seadra': ['mr.mime', 'scyther', 'jynx', 'electabuzz', 'magmar'],
    'exeggutor': ['mr.mime', 'dragonite', 'hitmonchan', 'flareon', 'gyarados'],
    'koffing': ['weezing', 'chansey', 'omastar'],
    'farfetchd': ['rhyhorn', 'cloyster', 'moltres', 'vaporeon', 'dodrio'],
    'jolteon': ['kabutops', 'snorlax', 'omastar', 'aerodactyl'],
    'sandshrew': ['lickitung', 'nidoranmale', 'clefairy'],
    'magmar': ['snorlax', 'tauros', 'pinsir', 'lapras'],
    'electrode': ['lapras', 'staryu', 'seaking', 'marowak', 'horsea'],
    'dratini': [],
    'mankey': ['farfetchd', 'electrode'],
    'magneton': ['mr.mime', 'kabutops'],
    'staryu': ['ditto', 'dratini'],
    'seaking': ['staryu', 'magikarp', 'starmie', 'dragonite'],
    'caterpie': ['weedle', 'vulpix', 'shellder', 'moltres'],
    'blastoise': ['electrode', 'vileplume', 'gastly', 'goldeen', 'sandslash'],
    'pidgeotto': ['lickitung', 'spearow'],
    'pikachu': ['hitmonlee'],
    'weepinbell': [],
    'gastly': ['seadra', 'mew', 'rhydon', 'horsea', 'tangela'],
    'scyther': ['jynx', 'articuno', 'mew'],
    'porygon': ['aerodactyl', 'mewtwo', 'kabuto'],
    'poliwrath': ['machop', 'victreebel', 'seel', 'gengar', 'vaporeon'],
    'dragonite': ['mewtwo', 'mew'],
    'geodude': ['magneton', 'seel', 'cubone'],
    'hitmonchan': [],
    'lickitung': [],
    'eevee': ['articuno', 'jolteon', 'flareon'],
    'venomoth': [],
    'moltres': ['dragonair'],
    'metapod': [],
    'horsea': ['moltres'],
    'graveler': ['seaking', 'tangela', 'slowpoke'],
    'kangaskhan': ['dragonite', 'kabuto', 'zapdos', 'moltres'],
    'cloyster': ['mr.mime', 'marowak', 'kabutops', 'gengar', 'eevee'],
    'machop': ['staryu', 'machamp', 'slowpoke', 'dodrio'],
    'kakuna': ['scyther', 'zubat'],
    'voltorb': ['porygon', 'pinsir', 'dragonite', 'jolteon', 'moltres'],
    'ninetales': ['farfetchd', 'parasect', 'ponyta', 'mewtwo'],
    'machamp': ['onix', 'marowak'],
    'jynx': ['dratini', 'tauros', 'snorlax'],
    'seel': ['haunter', 'kangaskhan'],
    'dewgong': ['hitmonchan', 'pinsir', 'eevee'],
    'growlithe': ['kabutops', 'shellder', 'farfetchd', 'chansey'],
    'vaporeon': ['porygon', 'jolteon', 'aerodactyl'],
    'haunter': ['koffing', 'rhyhorn', 'aerodactyl'],
    'nidorina': [],
    'alakazam': ['krabby', 'machoke', 'tauros', 'horsea'],
    'venonat': ['magmar', 'drowzee'],
    'nidoranmale': [],
    'omastar': [],
    'golbat': ['scyther', 'parasect', 'oddish'],
    'parasect': ['persian', 'electabuzz'],
    'squirtle': [],
    'drowzee': [],
    'chansey': ['pinsir', 'vaporeon'],
    'slowbro': [],
    'rhyhorn': ['staryu'],
    'clefable': ['golbat', 'ditto'],
    'goldeen': ['magikarp'],
    'zubat': ['eevee', 'gyarados', 'dodrio', 'seadra'],
    'doduo': ['shellder'],
    'lapras': ['omanyte', 'omastar', 'mewtwo'],
    'persian': ['golduck'],
    'psyduck': ['abra'],
}

# uncomment these lines when you are ready to test
# print("Using book1, can bulbasaur evolve to venusaur?")
# print(can_evolve(book1, "bulbasaur", "venusaur"))
# print("Using book1, can charmeleon evolve to blastoise?")
# print(can_evolve(book1, "charmeleon", "blastoise"))
# print("Using book2, can eevee evolve to articuno?")
# print(can_evolve(book2, "eevee", "articuno"))
# print("Using book3, can cubone evolve to charizard?")
# print(can_evolve(book3, "cubone", "charizard"))
# print("Using book3, can magikarp evolve to mewtwo?")
# print(can_evolve(book3, "magikarp", "mewtwo"))
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Here is the code for the question. Output also shown. Please don't forget to rate the answer if it helped. Thank you very much.

===============

def can_evolve(book, pokemon1, pokemon2):
  
if pokemon1 not in book: #check if the pokemon1 does not exists in the book
return False;
  
evolve_list = book[pokemon1]; #get the list of evolution for pokemon1
if not evolve_list: #is list empty
return False;
else:
if pokemon2 in evolve_list: #found pokemon2 in evolution list
return True;
else:
for p in evolve_list: #iterate through each pokemon and see if it can evolve to pokemon2
if can_evolve(book, p, pokemon2):
return True;
return False; #any pokemon in evolution list did not evolve to pokemon2

book1 = {
"squirtle" : ["wartortle"],
"wartortle" : ["blastoise"],
"blastoise" : [],
"charmander" : ["charmeleon"],
"charmeleon" : ["charizard"],
"charizard" : [],
"bulbasaur" : ["ivysaur"],
"ivysaur" : ["venusaur"],
"venusaur" : []
}

book2 = {
"eevee" : ["jolteon", "flareon", "vaporeon"],
"jolteon" : ["zapdos"],
"vaporeon" : ["articuno"],
"flareon" : ["moltres"]
}

book3 = {
'cubone': ['dragonite', 'magmar', 'tangela'],
'krabby': ['vaporeon', 'chansey', 'zapdos', 'electabuzz'],
'spearow': ['mewtwo', 'seadra', 'tentacool'],
'primeape': ['weepinbell', 'hitmonchan', 'mew', 'porygon', 'dewgong'],
'snorlax': ['moltres', 'dragonair', 'dratini', 'mewtwo', 'mew'],
'wartortle': ['rattata', 'weepinbell', 'seaking'],
'flareon': ['porygon', 'dratini', 'articuno'],
'clefairy': ['staryu'],
'rattata': ['bellsprout', 'nidorino'],
'machoke': ['staryu', 'bellsprout'],
'vileplume': ['doduo', 'victreebel', 'machop', 'starmie', 'kabuto'],
'dugtrio': ['golem', 'kadabra', 'rapidash', 'hitmonchan', 'aerodactyl'],
'venusaur': [],
'bulbasaur': [],
'onix': ['horsea'],
'weezing': ['snorlax'],
'beedrill': ['grimer', 'bellsprout', 'clefable', 'arbok'],
'butterfree': ['persian', 'dragonair', 'machop', 'starmie', 'dodrio'],
'charmeleon': ['oddish', 'seel', 'persian', 'seaking', 'poliwrath'],
'paras': ['seadra'],
'raticate': ['raichu', 'voltorb', 'sandshrew'],
'gyarados': ['articuno', 'moltres', 'flareon', 'dratini'],
'mr.mime': [],
'kabutops': ['dragonite', 'aerodactyl', 'mewtwo', 'dragonair'],
'poliwhirl': ['golem', 'graveler', 'magikarp', 'electabuzz', 'mr.mime'],
'muk': ['tauros', 'omanyte', 'mewtwo', 'electrode', 'cubone'],
'rapidash': ['gyarados', 'electrode'],
'golem': [],
'rhydon': ['jynx'],
'zapdos': ['dragonair', 'mewtwo', 'dratini'],
'golduck': ['hypno', 'dewgong', 'jolteon', 'poliwag'],
'gengar': ['jolteon', 'seaking', 'jynx'],
'arcanine': [],
'mew': [],
'gloom': [],
'vulpix': ['wigglytuff'],
'articuno': ['mew', 'zapdos', 'dragonair'],
'ponyta': ['eevee', 'tauros', 'mr.mime', 'horsea'],
'pinsir': ['ditto', 'zapdos'],
'grimer': ['kabutops'],
'nidoqueen': [],
'tangela': ['horsea', 'scyther', 'pinsir', 'kabutops', 'mewtwo'],
'ivysaur': ['marowak', 'krabby', 'growlithe'],
'electabuzz': ['gyarados', 'ditto', 'kabutops', 'porygon'],
'weedle': ['raichu', 'mew', 'snorlax', 'voltorb'],
'omanyte': ['mewtwo', 'zapdos'],
'magnemite': [],
'marowak': ['dratini', 'porygon', 'kabutops', 'goldeen'],
'pidgey': [],
'dragonair': [],
'poliwag': [],
'magikarp': ['articuno', 'kabutops', 'lapras', 'mew'],
'fearow': ['omastar'],
'slowpoke': ['koffing', 'farfetchd', 'hypno', 'krabby', 'gengar'],
'starmie': ['dragonite', 'magikarp', 'scyther'],
'ekans': ['slowbro', 'paras', 'electrode', 'rapidash'],
'meowth': ['dodrio', 'poliwrath', 'ditto', 'tentacool', 'aerodactyl'],
'raichu': [],
'kabuto': ['aerodactyl', 'articuno', 'kabutops'],
'charizard': [],
'oddish': ['flareon', 'horsea', 'drowzee', 'tauros'],
'wigglytuff': ['dragonite', 'oddish'],
'pidgeot': ['seel', 'bellsprout'],
'hitmonlee': ['seaking', 'mew', 'gyarados'],
'charmander': [],
'mewtwo': ['mew'],
'bellsprout': ['tauros', 'gengar', 'electabuzz', 'ponyta'],
'hypno': ['flareon'],
'kadabra': [],
'nidoking': ['venonat', 'muk', 'farfetchd', 'zubat', 'articuno'],
'sandslash': ['gyarados', 'golbat', 'alakazam', 'mewtwo', 'poliwrath'],
'diglett': ['graveler'],
'ditto': ['kabuto', 'vaporeon', 'aerodactyl'],
'arbok': ['horsea', 'primeape', 'hitmonlee'],
'abra': ['grimer', 'tangela', 'dragonite'],
'jigglypuff': [],
'tentacool': ['weezing', 'mewtwo', 'farfetchd', 'moltres', 'grimer'],
'tentacruel': ['dodrio'],
'tauros': ['flareon', 'moltres', 'porygon', 'omanyte'],
'dodrio': [],
'exeggcute': [],
'victreebel': ['tentacruel', 'seaking', 'ditto', 'lapras'],
'nidoranfemale': ['jynx', 'persian', 'shellder', 'mewtwo'],
'shellder': ['vaporeon', 'marowak', 'articuno', 'tauros', 'gyarados'],
'nidorino': ['omanyte', 'gastly', 'magneton', 'marowak', 'paras'],
'aerodactyl': ['zapdos'],
'kingler': ['mew', 'cubone', 'mr.mime', 'dratini', 'weezing'],
'seadra': ['mr.mime', 'scyther', 'jynx', 'electabuzz', 'magmar'],
'exeggutor': ['mr.mime', 'dragonite', 'hitmonchan', 'flareon', 'gyarados'],
'koffing': ['weezing', 'chansey', 'omastar'],
'farfetchd': ['rhyhorn', 'cloyster', 'moltres', 'vaporeon', 'dodrio'],
'jolteon': ['kabutops', 'snorlax', 'omastar', 'aerodactyl'],
'sandshrew': ['lickitung', 'nidoranmale', 'clefairy'],
'magmar': ['snorlax', 'tauros', 'pinsir', 'lapras'],
'electrode': ['lapras', 'staryu', 'seaking', 'marowak', 'horsea'],
'dratini': [],
'mankey': ['farfetchd', 'electrode'],
'magneton': ['mr.mime', 'kabutops'],
'staryu': ['ditto', 'dratini'],
'seaking': ['staryu', 'magikarp', 'starmie', 'dragonite'],
'caterpie': ['weedle', 'vulpix', 'shellder', 'moltres'],
'blastoise': ['electrode', 'vileplume', 'gastly', 'goldeen', 'sandslash'],
'pidgeotto': ['lickitung', 'spearow'],
'pikachu': ['hitmonlee'],
'weepinbell': [],
'gastly': ['seadra', 'mew', 'rhydon', 'horsea', 'tangela'],
'scyther': ['jynx', 'articuno', 'mew'],
'porygon': ['aerodactyl', 'mewtwo', 'kabuto'],
'poliwrath': ['machop', 'victreebel', 'seel', 'gengar', 'vaporeon'],
'dragonite': ['mewtwo', 'mew'],
'geodude': ['magneton', 'seel', 'cubone'],
'hitmonchan': [],
'lickitung': [],
'eevee': ['articuno', 'jolteon', 'flareon'],
'venomoth': [],
'moltres': ['dragonair'],
'metapod': [],
'horsea': ['moltres'],
'graveler': ['seaking', 'tangela', 'slowpoke'],
'kangaskhan': ['dragonite', 'kabuto', 'zapdos', 'moltres'],
'cloyster': ['mr.mime', 'marowak', 'kabutops', 'gengar', 'eevee'],
'machop': ['staryu', 'machamp', 'slowpoke', 'dodrio'],
'kakuna': ['scyther', 'zubat'],
'voltorb': ['porygon', 'pinsir', 'dragonite', 'jolteon', 'moltres'],
'ninetales': ['farfetchd', 'parasect', 'ponyta', 'mewtwo'],
'machamp': ['onix', 'marowak'],
'jynx': ['dratini', 'tauros', 'snorlax'],
'seel': ['haunter', 'kangaskhan'],
'dewgong': ['hitmonchan', 'pinsir', 'eevee'],
'growlithe': ['kabutops', 'shellder', 'farfetchd', 'chansey'],
'vaporeon': ['porygon', 'jolteon', 'aerodactyl'],
'haunter': ['koffing', 'rhyhorn', 'aerodactyl'],
'nidorina': [],
'alakazam': ['krabby', 'machoke', 'tauros', 'horsea'],
'venonat': ['magmar', 'drowzee'],
'nidoranmale': [],
'omastar': [],
'golbat': ['scyther', 'parasect', 'oddish'],
'parasect': ['persian', 'electabuzz'],
'squirtle': [],
'drowzee': [],
'chansey': ['pinsir', 'vaporeon'],
'slowbro': [],
'rhyhorn': ['staryu'],
'clefable': ['golbat', 'ditto'],
'goldeen': ['magikarp'],
'zubat': ['eevee', 'gyarados', 'dodrio', 'seadra'],
'doduo': ['shellder'],
'lapras': ['omanyte', 'omastar', 'mewtwo'],
'persian': ['golduck'],
'psyduck': ['abra'],
}

print("Using book1, can bulbasaur evolve to venusaur?")
print(can_evolve(book1, "bulbasaur", "venusaur"))
print("Using book1, can charmeleon evolve to blastoise?")
print(can_evolve(book1, "charmeleon", "blastoise"))
print("Using book2, can eevee evolve to articuno?")
print(can_evolve(book2, "eevee", "articuno"))
print("Using book3, can cubone evolve to charizard?")
print(can_evolve(book3, "cubone", "charizard"))
print("Using book3, can magikarp evolve to mewtwo?")
print(can_evolve(book3, "magikarp", "mewtwo"))

========

output

=====

>>>
Using book1, can bulbasaur evolve to venusaur?
True
Using book1, can charmeleon evolve to blastoise?
False
Using book2, can eevee evolve to articuno?
True
Using book3, can cubone evolve to charizard?
False
Using book3, can magikarp evolve to mewtwo?
True
>>>

Add a comment
Know the answer?
Add Answer to:
PYTHON 3.0 HELP!!! book1 = { "squirtle" : ["wartortle"], "wartortle" : ["blastoise"], "blastoise" : [], "charmander"...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create a new program in Mu and save it as ps4.5.3.py and take the code below...

    Create a new program in Mu and save it as ps4.5.3.py and take the code below and fix it as indicated in the comments: # In the Pokemon video game series, every Pokemon has six # stats: HP, Attack, Defense, Special Attack, Special Defense, # and Speed. # # Write a function called total_stats that will take as input # a list of dictionaries. Each dictionary will have seven # key-value pairs: # # - name: a Pokemon's name #...

  • In C++ Instructions Project 2: Gotta Catch ‘Em All Due: July 16 by Midnight For this...

    In C++ Instructions Project 2: Gotta Catch ‘Em All Due: July 16 by Midnight For this project you will be designing and implementing a system, in C++, to catalogue Pokémon, their trainers, and the local Pokémon gyms. Your system should act as a database and allow the user to load in multiple tables of data, run basic queries on the data, and then store the data off for later use. Additionally, sample input files will not be uploaded to Canvas,...

  • I need help on these functions PYTHON 3. The information about the functions is in the...

    I need help on these functions PYTHON 3. The information about the functions is in the first two pics. Scenario The Pokemon franchise consists of over 60 video games, 15 movies, several TV shows, a trading card game, and even a musical. It has been around for over two decades and at this point has fans of all ages. Because of this, people have become somewhat analytical about how they play the games. To help players of the Pokemon video...

  • Help needed with Python 3: Dictionaries and Sets. The problem is one that asks the user to create...

    Help needed with Python 3: Dictionaries and Sets. The problem is one that asks the user to create a completed program that prompts the user for the name of a data file, and reads the contents of that data file, then creates variables in a form suitable for computing the answer to some questions. The format should be in the same manner as the attached .py file. All subsequent assignment details (.py and .csv files) can be found at this...

  • Python   #complete the following lines of code wherever indicated. 5 question 20 points a piece #you...

    Python   #complete the following lines of code wherever indicated. 5 question 20 points a piece #you may use your book and internet but no form of messaging or communication #QUESTION 1 #Read in the file exam_file.txt #Print to the console every other line #QUESTION 2 #Read in exam_file.txt #split file into words #write to a file called question2.out that contains 1 word per line (words can occur more than once) #QUESTION 3 # Print out all the Middle Initials in...

  • Python #complete the following lines of code wherever indicated. 5 question 20 points a piece #you...

    Python #complete the following lines of code wherever indicated. 5 question 20 points a piece #you may use your book and internet but no form of messaging or communication #QUESTION 1 #Read in the file exam_file.txt #Print to the console every other line #QUESTION 2 #Read in exam_file.txt #split file into words #write to a file called question2.out that contains 1 word per line (words can occur more than once) #QUESTION 3 # Print out all the Middle Initials in...

  • Python Programming (Just need the Code) Index.py #Python 3.0 import re import os import collections import...

    Python Programming (Just need the Code) Index.py #Python 3.0 import re import os import collections import time #import other modules as needed class index:    def __init__(self,path):    def buildIndex(self):        #function to read documents from collection, tokenize and build the index with tokens        # implement additional functionality to support methods 1 - 4        #use unique document integer IDs    def exact_query(self, query_terms, k):    #function for exact top K retrieval (method 1)    #Returns...

  • Python program This assignment requires you to write a single large program. I have broken it...

    Python program This assignment requires you to write a single large program. I have broken it into two parts below as a suggestion for how to approach writing the code. Please turn in one program file. Sentiment Analysis is a Big Data problem which seeks to determine the general attitude of a writer given some text they have written. For instance, we would like to have a program that could look at the text "The film was a breath of...

  • Python please help! Thanks you Write a code to get an unlimited number of grades from...

    Python please help! Thanks you Write a code to get an unlimited number of grades from the user (the user can press enter to finish the grades input, or use a sentinel, for example-1), and then calculate the GPA of all the grades and displays the GPA To do this you might need some help. Try to follow the following process (and check your progress by printing different values to make sure they are as they supposed to be): 1-...

  • USING PYTHON IDLE 3.4: NEED HELP WITH THIS PLEASE! :( Question #8: You want to determine...

    USING PYTHON IDLE 3.4: NEED HELP WITH THIS PLEASE! :( Question #8: You want to determine the distance to lightning strikes during a storm. This can be measured using the time elapsed between seeing the lightning flash and hearing the thunder. You know that the speed of sound is approximately 1,100 ft/second and 1 mile is 5,280 feet. Write a program named q8.py that prompts the user for the number of lightning strikes to analyze and the number of seconds...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT