DEV Community

Discussion on: Daily Challenge #280 - Driving School

Collapse
gagandureja profile image
Gagan

Python

def cost(minutes):
    if minutes <66: return 0 if minutes<6 else 30
    half = (minutes-65)//30 + (((minutes-65)%30)>0)
    return 30 + half*10