0

Challenge: The program below doesn't run well find and fix the error

# save this as a *.py file (the * is a variable for any text) max = int(input("How much courses: ")) courses = [] units = [] grades = [] total = [] grades_notes = { 'A': 5, 'a': 5, 'B': 4, 'b': 4, 'C': 3, 'c': 3, 'D': 2, 'd': 2, 'F': 1, 'f': 1, } for i in range(max): print(i+1, ". course: ", end="", sep="") courses.append(input()) print(i+1, ". unit: ", end="", sep="") units.append(input()) print(i+1, ". grade: ", end="", sep="") grades.app

19th Feb 2017, 3:49 PM
Mzik Chan
Mzik Chan - avatar
2 Respostas
+ 1
What's is the problem exactly? After studying it to understand what was expected as user entry, and give it correct values, he seem's to be ok ^^
19th Feb 2017, 9:20 PM
visph
visph - avatar
0
rest of the code. grades.append(input()) print() for i in range(max): a = int(units[i]) * int(grades_notes[grades[i]]) print(i, ". course: ", courses[i], ": ", a, sep="") total.append(a) a = 0 for i in range(len(total)): a += total[i] print("Total: ", a/len(total), sep="")
19th Feb 2017, 3:51 PM
Mzik Chan
Mzik Chan - avatar