Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

python 3.6 What\'s allowed? is the exhaustive list of things you can use on the

ID: 3857230 • Letter: P

Question

python 3.6

What's allowed? is the exhaustive list of things you can use on the projec all basic expressions/operators, indexing/slicing all basic statements: assignment, selection, and loop statements, break/continue, return here is the exhaustive list of things you can use on the project. . functions: len), range(), min(), max(), sanitize() (you'll write sanitize!) file reading: open), close), read(), readline(), readlines), with syntax dictionaries: all methods listed in our slides on that one chart. methods: ists: remove), insert), append(), extend) pop() strings: strip), split), join), remove(), insert), lower) sorted (), sort(), reversed (), reverse() This means that... ·you can't call anything not listed above. Focus on applying these functions to solve the task. you can't import any modules for this project. (so you can't import csv either-but it isn't that helpful)

Explanation / Answer

# all different years, all same names. file4="""YEAR,NAME,MinPressure,Gender,CATEGORY,deaths,DamageMillions 2001,A,901,M,1,100,1000 2002,A,902,M,2,200,2000 2003,A,903,M,3,300,3000 2004,A,904,M,4,400,4000 2005,A,905,M,5,500,5000 2006,A,906,F,1,600,6000 2007,A,907,F,2,700,7000 2008,A,908,F,3,800,8000 2009,A,909,F,4,900,9000 2010,A,910,F,5,1000,10000 """ database4 = {2001: [('A', 1, 100, 1000)], 2002: [('A', 2, 200, 2000)], 2003: [('A', 3, 300, 3000)], 2004: [('A', 4, 400, 4000)], 2005: [('A', 5, 500, 5000)], 2006: [('A', 1, 600, 6000)], 2007: [('A', 2, 700, 7000)], 2008: [('A', 3, 800, 8000)], 2009: [('A', 4, 900, 9000)], 2010: [('A', 5, 1000, 10000)]} # all same year, cat, toll, cost. (only names differ) file5="""YEAR,NAME,MinPressure,Gender,CATEGORY,deaths,DamageMillions 2001,A,901,M,3,400,100 2001,B,902,M,3,400,100 2001,C,903,M,3,400,100 2001,D,904,M,3,400,100 2001,E,905,M,3,400,100""" database5 = {2001: [('A', 3, 400, 100), ('B', 3, 400, 100), ('C', 3, 400, 100), ('D', 3, 400, 100), ('E', 3, 400, 100)]}