Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

get 3 grades from the user, store it in a list, calculate the average, …

Question

get 3 grades from the user, store it in a list, calculate the average, check see if it is over 60, print you passed! and if it is under 60, print you failed!

Explanation:

Step1: Create an empty list

grades = []

Step2: Get 3 grades from user and append to list

for i in range(3):
grade = int(input("Enter a grade: "))
grades.append(grade)

Step3: Calculate the average

average = sum(grades)/len(grades)

Step4: Check if average is over 60

if average > 60:
print("you passed!")
else:
print("you failed!")

Answer:

The program will prompt for 3 grades, calculate their average and print whether the user passed or failed based on if the average is over 60.