Skip to content
DeepForgeby svx
All problems
EasyML Fundamentalsml-208

Churn Rate

Problem

Compute the churn rate in percent: churned / start_count * 100.

Return 0.0 when start_count is 0.

Hint

Churn is customers lost divided by customers at the start of the period.

Test cases

case 1
in: [100,5]
expected: 5
case 2
in: [80,4]
expected: 5
case 3
in: [50,0]
expected: 0
case 4
in: [0,3]
expected: 0
Starter codePython
def churn_rate(start_count, churned_count):
    # Your code here
    pass

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