"""
import math
print math.sqrt(30)
print math.sqrt(123)
print math.sqrt(80)
from math import sqrt
print sqrt(21)
print sqrt(90)
print sqrt(70)
"""
#Take vacation project
def hotel_cost(nights):
return nights*90
def bus_ticket_cost(city):
if city=="buchanan":
return 245
elif city=="kakata":
return 180
elif city=="zwedru":
return 742
elif city=="happer":
return 1230
def rental_bike_cost(days):
per_day=days*40
if days>3:
return per_day-20
elif days>=7:
return per_day-50
else:
return per_day
def trip_cost(city,days,spending_money):
return rental_bike_cost(days)+hotel_cost(days)+bus_ticket_cost(city)+spending_money
print trip_cost("zwedru",5, 200)
No comments:
Post a Comment