Why does this code doesnt work in eclipse ide,but it works in codecademy


#1


#2

this code also throw an interpreter error on codecademy

lloyd is dictionary, so you are comparing dictionary (score) with integer, that won’t work


#3

i ran this same code in codecademy i got an output.
what should be the code so that eclipse doesnt throw an error?


#4

seems i was a bit hasty, you seem to run python3, seems behavioural changes where made to the python programming language.

but even within codecademy, you should notice something is off. lloyd his average grade is 80.55, yet he gets an A. That can’t be right

that is for you to figure out, i am not going to tell you what the code is, i am going to help you

so what is the purpose of get_letter_grade functions? Think about it for a second, here is the answer when you are ready:

to convert number grade to letter grade

is lloyd a number grade? No, its a dictionary.

if you look at the error, you will see that python tells you its not happy to compare dictionary (score which has value of lloyd dictionary) with integer. So we need to pass integer as argument at function call.


#5

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