[Tutor] cases with single if and an else clause

Dennis Lee Bieber wlfraed at ix.netcom.com
Wed Oct 6 11:43:38 EDT 2021


On Wed, 6 Oct 2021 16:34:43 +0530, Manprit Singh
<manpritsinghece at gmail.com> declaimed the following:

>
>I  saw your explanation about my question :
>GRADES = [ (60, "F"),
>           (70, "D"),
>           (80, "C"),
>           (90, "B"),
>           (100, "A") ] #ordered list of breakpoints
>
>These were the grades you have used, There is a problem, See if the marks
>are 60 That should not be classified as F . The pattern must be like as
>follows :
>
>if marks >=90   and  <= 100  ---- "A" Grade
>else marks >= 80 and  < 90  ----  "B" Grade
>else marks >= 70 and  < 80  ----  "C" Grade
>else marks >= 60 and <  70  ----  "D" Grade
>else marks below 60 ---- "F" or Fail

	Using those ranges means that "A" is achieved for 11 scores, but "B",
"C", and "D" are only achieved for 10 scores each -- an imbalance (or bias)
in distributing letter grades. 

A	90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100
B	80, 81, 82, 83, 84, 85, 86, 87, 88, 89
(with the B pattern applied to C and D)

	The break points I used mean that each letter grade A..D has only 10
matching scores -- with F absorbing everything below (including the fact
that 0..100 spans 101 distinct scores; logically one might expect 0..99 or
1..100 <G>).
. 


-- 
	Wulfraed                 Dennis Lee Bieber         AF6VN
	wlfraed at ix.netcom.com    http://wlfraed.microdiversity.freeddns.org/



More information about the Tutor mailing list