All problems
Trading Day Adjustment Lite
Problem
Adjust a value for the number of trading days in the period: adjusted = value * average_days / actual_days.
Return 0.0 when actual_days is zero.
Hint
Fewer trading days than average scales the value up, and vice versa.
Test cases
case 1
in: [1000,20,22]
expected: 1100
case 2
in: [500,25,25]
expected: 500
case 3
in: [990,22,20]
expected: 900
case 4
in: [100,0,20]
expected: 0
Starter codePython
def trading_day_adjustment(value, actual_days, average_days):
# Your code here
pass4 test cases · run your code against them in the editor