Grade (2) X84310


Statement
 

pdf   zip

Write a function @grade(s)@ that given a float score ss such that 0s100\le s \le 10 returns the grade string that corresponds to ss. The result of the function has to stick to the catalan grading rules: when ss is less than 55 the grade is ’suspens’, when ss is at least 55 but less than 77 the grade is ’aprovat’, when ss is at least 77 but less than 99 is ’notable’, when ss is at least 99 but less than 1010 is ’excel.lent’ —note that the dot is the usual one— and finally, if ss is 1010 the grade is ’MH’.

Sample session

Sample session
>>> grade(4.99)
'suspens'
>>> grade(8)
'notable'
>>> grade(6.99)
'aprovat'
>>> grade(9.5)
'excel.lent'
>>> grade(10)
'MH'
Information
Author
ProAl
Language
English
Official solutions
Python
User solutions
Python