Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python help please for I am suffering Pokemon: We will use three different representations for a Pokemon inside our programs, but all three will be

Python help please for I am suffering

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Pokemon: We will use three different representations for a Pokemon inside our programs, but all three will be based on a tuple with values in some order. The first format (based on the information in an "info" file) will be called INFO FORMAT and will consist of a key-value pair structured as the following examples. name: (id, type1, type2, generation, legendary) 'Bulbasaur 1, Grass Poison 1, False) 'Charmander (4 Fire None, 1, False) The second format (based on the information in a "stats" file) will be called STATS FORMAT and will consist of a key-value pair structured as follows id: (hp, attack, defense, speed) 1: (45, 49, 49, 45) The final format for a Pokemon will combine the two prior formats into a format for our DATABASE (see next section and will consist of a key-value pair with the following structure: name: (id, type1, type2, hp, attack, defense, speed, generation, legendary) 45, 49, 49, 45, 1, False) "Bulbasaur 1, Grass Poison Note that name, typel, and type2 fields are strings, id, generation, and all the stats are integers, and the Pokemon's legendary status is a boolean. Additionally, for pokemon that aren't dual type, the 2nd type is set to be None. (Also notice that none of the formats duplicate the key as part of the data, as duplicated information is rarely a good idea) Database: a "database" of Pokemon can store multiple Pokemon by name. Our database will be a dictionary whose keys are Pokemon names, and whose values are tuples of interesting information about the Pokemon (in the combined final database format shown above). Only Pokemon with stored information and statistics may be present sample db (1 Poison 1, False), Bulb 49, 49, 45 Grass 45 (4 Fire 39, 52, 43, 65 1, False), "Charmander None (6, Fire Flying 78, 84, 78,100, 1, False), "Charizard" (146, Fire Flying 90, 100, 90, 90, 1, True) Moltres (169 Poison Flying 85, 90, 80, 130, 2, False), Crobat "Tornadus, (Incarnate Form) (641 Flying None 79,115, 70,111 5, True), Reshiram (643, Dragon Fire 100,120,100, 90, 5, True) Functions You must implement the following functions. Examples can be found later in this document (under Examples"). Methods NEVER modify the given database, but some functions create a new database

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

Step: 3

blur-text-image

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

Databases And Information Systems 1 International Baltic Conference Dbandis 2020 Tallinn Estonia June 19 2020 Proceedings

Authors: Tarmo Robal ,Hele-Mai Haav ,Jaan Penjam ,Raimundas Matulevicius

1st Edition

303057671X, 978-3030576714

More Books

Students also viewed these Databases questions

Question

LO2 Compare three types of individual incentives.

Answered: 1 week ago