Answered step by step
Verified Expert Solution
Link Copied!

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 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

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

How To Build A Million Dollar Database

Authors: Michelle Bergquist

1st Edition

0615246842, 978-0615246840

Students also viewed these Databases questions

Question

a neglect of quality in relationship to international competitors;

Answered: 1 week ago