All problems
Stanine Conversion
Problem
Convert a z-score to a stanine with round(5 + 2*z), clamping the result to the 1-9 range. Rounding happens before clamping.
Hint
Stanines are a nine-point standard scale with mean 5 and step 2.
Test cases
case 1
in: [0]
expected: 5
case 2
in: [1.2]
expected: 7
case 3
in: [-1.3]
expected: 2
case 4
in: [2.5]
expected: 9
case 5
in: [-3]
expected: 1
Starter codePython
def stanine(z):
# Your code here
pass5 test cases · run your code against them in the editor