Metro Card Rides

In [11]:
def minAmount(n):
    m = 2.75
    while m*(1.11) < n*2.75:
        m += 0.05
    return round(m,2)
In [12]:
for i in range(1,11):
    print(minAmount(i))
2.75
5.0
7.45
9.95
12.4
14.9
17.35
19.85
22.3
24.8

This is a simplified version of the problem. In the real problem, the bonus is not applied until you put in at least $5.50 on a card.

In [ ]: