Hiiii, thank you for all the answers! I've figured this out! I can't delete this message tho, and I'm not sure how to make it inactive. basically i am a mess. but thank you everyone!!!
Okay i am actually having 456344 problems, but this is my current one here is my code:
def averages():
grade = 0
x = eval(input("How many grades will you be entering? "))
if type(x) != type(int(x)):
x = eval(input("You can't enter that many grades. How many grades will you be entering? "))
for i in range(x):
y = eval(input("Please enter a grade between 0 and 100: "))
if 0 <= y <= 100:
grade = grade + y
else:
print("Your number is out of range!")
y = eval(input("Please enter a grade between 0 and 100: "))
average = grade/x
print (y)
print (x)
print (grade)
print (average)
averages()
basically whenever i run the code this part doesn't work:
if 0 <= y <= 100:
grade = grade + y
and it only calculates the last number entered in the average. Also, I'm supposed to make it give an error message if the number entered by the user is out of range (not between 0 and 100), but the error message isn't coming up? I'm not sure what's happening. Please help, thank you.