What i want is to reflect an a 'A' if a student gets anything between 100% 
and 80%, hence the line 
if perc>=100:
            grade='A'

and get grade 'B' if a student gets anything between79% and 70% hence the 
line
elif perc>=79:
            grade='B'
elif perc>=69:
            grade='C'
When i coded it i thought it's straight forward it'd reflect correctly but 
instead 70% gives me 'C' and 80% to 90% give me a 'B'!!!! I Cant figure out 
what I'm doing wrong where!


On Sunday, November 19, 2017 at 1:06:20 AM UTC+2, Anthony wrote:
>
>
>
> On Saturday, November 18, 2017 at 9:15:36 AM UTC-5, mostwanted wrote:
>>
>> I want grade 'A' to fall within a range of percentages, 'A' ranges from 
>> 80%(being the lowest) to 100%(being the highest), how do i reflect that 
>> here to get the system to grade properly??
>>
>
> if perc >= 80:
>
> The upper range doesn't matter, as presumably 100 is the maximum anyway.
>
> Note, though, that you have defined a B as >= 79. That means that you get 
> a B only if your percentage is between 79 and 80 -- once you hit 80, it's 
> an A. Is that really what you want?
>
> Anthony
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to