Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Jupyter notebook metroCards.ipynb

Project: NYCWiC
Views: 135
Kernel: Python 3 (Anaconda)

Metro Card Rides

def minAmount(n): m = 2.75 while m*(1.11) < n*2.75: m += 0.05 return round(m,2)
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.