QUESTION IMAGE
Question
jump to level 1
given grade1, grade2, and grade3 read from input, compute the average and assign avg_grade with the result.
click here for example
1 grade1 = int(input())
2 grade2 = int(input())
3 grade3 = int(input())
4
5
6
7 print(f\average grade: {avg_grade:.2f}\)
Step1: Calculate sum of grades
$grade1 + grade2 + grade3$
Step2: Compute average of 3 grades
$\text{avg_grade} = \frac{grade1 + grade2 + grade3}{3}$
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
Add the following line as line 5 in the code:
avg_grade = (grade1 + grade2 + grade3) / 3
The complete code will be:
grade1 = int(input())
grade2 = int(input())
grade3 = int(input())
avg_grade = (grade1 + grade2 + grade3) / 3
print(f"Average grade: {avg_grade:.2f}")