diff --git a/2/2.5 Grade Calculation/grade_calculation/grade_calculation.py b/2/2.5 Grade Calculation/grade_calculation/grade_calculation.py new file mode 100644 index 0000000..ca135c9 --- /dev/null +++ b/2/2.5 Grade Calculation/grade_calculation/grade_calculation.py @@ -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)