大きな欠陥や、書式設定や基本的な方法に見られる何かがある場合は、指摘してください。ありがとう!
day = raw_input("How many days?")
locations = raw_input("Where to?")
days = str(day)
location = str(locations)
spendingMoney = 100
def hotel(days):
return 140 * days
def destination(location):
if location == "los angeles":
return 300
if location == "boston":
return 400
def rental(days):
if days < 2:
return 40 * days
if days >= 2 and days <= 6:
return days * 30
if days >= 7:
return days * 25
def total_cost(days, location):
return hotel(days) + destination(location) + rental(days)
print total_cost(days, location)