SHOW:
|
|
- or go back to the newest paste.
1 | def hotel_cost(nights): | |
2 | return 140 * nights | |
3 | ||
4 | def plane_ride_cost(city): | |
5 | if city == "Charlotte": | |
6 | return 183 | |
7 | elif city == "Tampa": | |
8 | return 220 | |
9 | elif city == "Pittsburgh": | |
10 | return 222 | |
11 | elif city == "Los Angeles": | |
12 | return 475 | |
13 | ||
14 | def rental_car_cost(days): | |
15 | if days >= 7: | |
16 | return 40 * days - 50 | |
17 | elif days >= 3: | |
18 | return 40 * days - 20 | |
19 | else: | |
20 | return 40 * days | |
21 | ||
22 | def trip_cost(city, days, spendingmoney): | |
23 | return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city) + spendingmoney | |
24 | - | |
24 | + | print trip_cost("Los Angeles", 5, 600) |