jeudi 27 juin 2019

I need some help for def if statments

I need to input as many grades until I press -1 to end it


def content (int[m])):
    if m < 50:
        g = 'Grade is F'
    else:
        if float m < 60:
            g = 'Grade is C'
        else:
            if float m < 70:
                g = 'Grade is B'
            else:
                g ='Grade is A'
    return g 

a=0
b= int(a)
c=0

while a != -1:
     a = input ('Enter Grade:')
     a += b
     if a == -1:
         print ('end')
         average = a/b
         break 
     else:
         content(a)


print (" The Average Grade {0}" .format(average))


It always comes out this error:

TypeError: can only concatenate str (not "int") to str

Aucun commentaire:

Enregistrer un commentaire