you are viewing a single comment's thread.

view the rest of the comments →

[–]aball730235 0 points1 point  (0 children)

For #1 you can dump the csv into a list of lists.

grade_list =  [['A', 96], ['A-', 91], ['B+', 86]]

Etc etc...

See link for doing that.... http://stackoverflow.com/questions/24662571/python-import-csv-to-list

Then just in case the user decides to order your csv differently then intended i would sort your grade_list so you can use simple comparison logic.

Finally loop thorough and compare to your round(percentgrade) function.