Quotes help make search much faster. Example: "Practice Makes Perfect"

Tuesday, November 27, 2012

Codecademy: Transportation


#sample solution


def hotelCost(days):
return days * 140

def planeRideCost(city):
if city == "Charlotte":
return 183
elif city == "Tampa":
return 220
elif city == "Pittsburgh":
return 222
elif city == "Los Angeles":
return 475
else:
return "Unknown destination"

def rentalCarCost(days):
totalCarCost = days * 40
if days < 3:
return totalCarCost
elif days >= 3 and days < 7:
return totalCarCost - 20
elif days >= 7:
return totalCarCost - 50

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts