Drill

ProblemsPython › finance

Variance from budget

easyfinancePython

A ledger compares what was planned against what actually happened: report the signed difference.

budget_variance(budget: int, actual: int) → int

Solve it in the editor →

Where you start

def budget_variance(budget: int, actual: int) -> int:
    

Worked examples

CallResult
budget_variance(100, 120)20
budget_variance(100, 90)-10
budget_variance(0, 0)0
budget_variance(50, 50)0

Hint

Subtract budget from actual.

Reference solution in Python
def budget_variance(budget: int, actual: int) -> int:
    return actual - budget

The same problem in another language

More finance problems in Python