All problems
Seasonal Adjustment Factor
Problem
Compute the seasonal adjustment factor as original / adjusted.
Return 1.0 when the adjusted value is 0 so no rescaling is applied.
Hint
Dividing the original by its adjusted value recovers the seasonal factor.
Test cases
case 1
in: [110,100]
expected: 1.1
case 2
in: [90,100]
expected: 0.9
case 3
in: [100,0]
expected: 1
case 4
in: [0,100]
expected: 0
Starter codePython
def seasonal_adjustment_factor(original, adjusted):
# Your code here
pass4 test cases · run your code against them in the editor