python--rounding value of expression--unexpected EOF -
in last line i'm trying round output 1 decimal place when test unexpected eof error. please?
count = 0 scoresum = 0 score = 0 while score != 999: score = float(input("enter test score or enter 999 finish: ")) if score > 0 , score < 100: scoresum += score count += 1 elif (score <0 or score > 100) , score != 999: print("this score invalid, enter 0-100") else: print ("your average is: ", round((scoresum / count), 2)
the last line problem--you need closing parenthesis:
print ("your average is: ", round((scoresum / count), 2)) # right here ^
actually, have line of code this:
print("your average is: ", round(scoresum / count, 2))
there no need parenthesis.
Comments
Post a Comment