Question
You want to write a Python program to compute the average of three integer quiz grades for a single student. Decide what variables your program
You want to write a Python program to compute the average of three integer quiz grades for a single student. Decide what variables your program needs, and create them with appropriate initial values.
(Please use Python for begginners and I am learning)
We have learned For x in range
I have this code so if you could correct it with comments that would be awesome!
#define variables
n1 = 0
n2 = 0
n3 = 0
average_grade = (n1 + n2 + n3)/3
#Get 3 integer from user
n1 = int (input ("please enter first grade: "))
n2 = int (input ("please enter second grade: "))
n3 = int (input ("please enter third grade: "))
#Calculate Average
for x in (n1, n2,n3):
average_grade
#print result to user
print (average_grade)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started