Hello everyone, I just get stuck in 7 exercise:
I should say that my code works, but there are some questions to make it better...
- How to check if argument is number when I define function?
====if score % 1 = 0:
Is this the only one way to check if arg is int? I hope there's another one more logical for ex
Have Python got something like this?
- My code prints "This is not int, bro" when I ask it to calculate letter_grade. Just take a look:
total = sum(numbers)
total = float(total)
total = total / len(numbers)
homework = average(student["homework"])
quizzes = average(student["quizzes"])
tests = average(student["tests"])
return homework * 0.1 + quizzes * 0.3 + tests * 0.6
if score % 1 == 0:
if score >= 90:
elif score >= 80:
elif score >= 70:
elif score >= 60:
return "This isn't int, bro..."
But why?? It has input number, and %1 should == 0. Then it should check if n >= 90 etc. Why it returns else statement?