Percentage grade to letter grade. I'm having trouble with my code. This is only the begining of my code. Help please. I | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Percentage grade to letter grade. I'm having trouble with my code. This is only the begining of my code. Help please. I

grade = (input()) grade = 100 if grade >= 90 and grade <= 100: print('a') if grade >= 80 and grade <= 89: print('b')

23rd May 2017, 7:46 PM
Talia Pacelli
Talia Pacelli - avatar
7 Answers
+ 7
You might need to cast your input to integer and also use "elif" in the if statement.
23rd May 2017, 8:21 PM
Wisdom Abioye
Wisdom Abioye - avatar
+ 7
You might want to try ternary statements here: if 80 <= x <= 89: block_of_code That keeps the code more concise.
23rd May 2017, 8:52 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 6
Make your code public. It's easy to help like that.
23rd May 2017, 8:19 PM
Wisdom Abioye
Wisdom Abioye - avatar
+ 4
I debuged it, The text needs work. edit I deleted the old post, its code was wrong https://code.sololearn.com/cYIMEBTrlWVL/?ref=app
23rd May 2017, 8:30 PM
Manual
Manual - avatar
+ 3
@Kuba Thank you, I did not know, that is was possible put statements together like that.
23rd May 2017, 9:28 PM
Manual
Manual - avatar
+ 1
still getting an error
23rd May 2017, 7:56 PM
Talia Pacelli
Talia Pacelli - avatar
+ 1
thank you everyone
23rd May 2017, 8:48 PM
Talia Pacelli
Talia Pacelli - avatar