Question: 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 15 Dagger 90.61751018
AT 11 Club 70.67109109
AT 17 Dagger 70.61781012
AT 12 Dagger 80.6787107
AT 14 Staff 20.7858811
AT 9 Staff 90.5153109
AT 18 Club 110.83116114
AT 11 Club 80.611181014
AT 15 Dagger 110.949101113
AT 15 Dagger 110.78981116
AT 13 Dagger 100.44751011
AT 10 Dagger 70.561612106
AT 13 Dagger 50.441210912
AT 15 Short sword 70.83871010
AT 14 Spear 30.7888814
AT 16 Staff 50.39106917
DB 17 Staff 50.671110911
The name of the file where the table is stored is: characters-mat.csv
Function 4: character_weapon_list
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 character_weapon_list(file_name: str, weapon: str)-> list[dict]:
"""
return a list of characters stored as a dictionary that their weapon is provided as the input parameters.
precondition: the file_name has the following columns ['occupation','strength','agility','stamina','personality','intelligence','luck','armor','weapon']
Examples
>>>Character_weapon_list('characters-mat.csv', 'Dagger')
[{'occcupation': 'AT','strength': 15,'agility': 9,'stamina':0.61,'intelligence': 7,'luck': 5, 'armor': 10, 'personality':18},{another element},...]
"""

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!