Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Occupation Strength Weapon Agility Stamina Intelligence Luck Armor Personality AT 1 5 Dagger 9 0 . 6 1 7 5 1 0 1 8 AT
Occupation Strength Weapon Agility Stamina Intelligence Luck Armor Personality
AT Dagger
AT Club
AT Dagger
AT Dagger
AT Staff
AT Staff
AT Club
AT Club
AT Dagger
AT Dagger
AT Dagger
AT Dagger
AT Dagger
AT Short sword
AT Spear
AT Staff
DB Staff
The name of the file where the table is stored is: charactersmat.csv
Function : characterweaponlist
The function takes the name of the file where the data is stored and a weapon value as input parameters. The function returns a list of characters stored as a dictionary that their weapon is provided as the input parameters. The keys of the dictionary are the labels for all attributes in the spreadsheet except Weapon If the weapon value provided is not on the file, the function returns an empty list. See below for the sample output of the function: See below for the sample output of the function.
def characterweaponlistfilename: str weapon: str listdict:
return a list of characters stored as a dictionary that their weapon is provided as the input parameters.
precondition: the filename has the following columns occupation'strength','agility','stamina','personality','intelligence','luck','armor','weapon'
Examples
Characterweaponlistcharactersmat.csv 'Dagger'
occcupation: AT'strength': 'agility': 'stamina':'intelligence': 'luck': 'armor': 'personality':another element
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started