- 1

Draw a decision tree for grade calculation

please use >90= A1, 80-90 =A2,70-80=B1, 60-70=B2 , 50-60=C1,40-50=C2,<40=F

24th Feb 2019, 4:11 AM
best result
best result - avatar
3 Antworten
+ 2
I’m not sure if this is what you’re looking for but try this function: def decideGrade(sc): if sc >= 90: return "A1" elif sc >=80: return "A2" elif sc >=70: return "B1" elif sc >=60: return "B2" elif sc >=50: return "C1" elif sc >=40: return "C2" else: return “F” Then call it like this: print(decideGrade(74)); Good luck!
24th Feb 2019, 4:57 AM
Mike Perkowski
Mike Perkowski - avatar
+ 2
Not really a decision tree, but it's your homework, not mine https://code.sololearn.com/craU3E9P6Eeq/?ref=app
24th Feb 2019, 6:38 AM
Anna
Anna - avatar
0
thanks
24th Feb 2019, 5:21 AM
best result
best result - avatar