Skip to content
DeepForgeby svx
All problems
EasyOptimizationop-371

Relative Improvement Percentage

Problem

The relative improvement from an old value to a new value is (old - new) / old * 100 percent.

Given old and new (old nonzero), return the percentage.

Hint

A larger positive number means a bigger gain.

Test cases

case 1
in: [100,90]
expected: 10
case 2
in: [2,1]
expected: 50
case 3
in: [50,75]
expected: -50
Starter codePython
def relative_improvement_percentage(old, new):
    # Your code here
    pass

3 test cases · run your code against them in the editor