Sending a letter


#1

I keep getting a syntax error in the first elif but i don't see what's wrong can anyone help please?

def get_letter_grade(score):
if score >= 90:
return "A"
elif score >= 80:
return "B"
elif score >= 70:
return "C"
elif score >= 60:
return "D"
else:
return "F"
print get_letter_grade(get_average(lloyd))


#2

Make sure that copying and running your code reproduces what you describe, what you have there probably results in an IndentationError so others won't be able to see what you're doing


#3

I already checked my indentations it just keeps marking a syntax error in my first elif but I don't understand why.


#4

Perhaps you've misunderstood how you're to indent it. Either way, others can't reproduce what you describe because the code is different. That's a problem when almost every single character has meaning


#5

you were right the indentation was off on the first elif but was marking it as a syntax error now it's giving me another error it's saying that get_letter_grade seems to be missing


#6

An indentation error is when the indentation itself doesn't make sense. In your case it was the elif that wasn't making sense, so that's a syntax error.

As for the next error, again, no clue what's happening without being able to reproduce it. I suggest testing your code and find out for yourself if there's something wrong that you can fix


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.