lundi 21 juin 2021

Why does my if statement not retrieve int from input function?

My current code to accept multiple inputs as integers then average them and assign them a letter grade keeps returning an error.

Warning (from warnings module):
  File "C:\Users\Luna Farrow\Desktop\Week5 Assignment.py", line 7
    if GradeAvg>=90 ():
SyntaxWarning: 'int' object is not callable; perhaps you missed a comma?

What could be causing the function to be unable to call the integer?

current code:

GradedSet = [int(x) for x in input("Enter multiple value: ").split(",")] #accepts multiple 
inputs for the graded set

GradeAvg = int((sum(GradedSet)/5))
    
print(GradeAvg)
    
if GradeAvg>=90 ():
print("A")

   

Aucun commentaire:

Enregistrer un commentaire