Create grade_calculation.py

This commit is contained in:
Joe S 2021-01-16 22:56:04 -05:00
parent 411c58ac5d
commit e494261948
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
def collect_grades():
grades = []
print('Enter a score on an exam. If the weight is different than x/100 specify using (grade)/(weight).')
while True:
_input = input('''Enter a score on an exam. ( 93 OR 93/100)\n(Press enter to stop):\n''')
if len(_input) == 0:
break
grades.append(_input)
return grades
if __name__ == '__main__':
print(collect_grades())
exam1_grade = float(input('Enter score on Exam 1 (out of 100):\n'))
exam2_grade = float(input('Enter score on Exam 2 (out of 100):\n'))
exam3_grade = float(input('Enter score on Exam 3 (out of 100):\n'))
overall_grade = (exam1_grade + exam2_grade + exam3_grade) / 3
print('Your overall grade is:', overall_grade)