1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | def hotel_cost(days): return 140*days def plane_ride_cost(city): if city == "Charlotte": return 183 elif city =="Tampa": return 220 elif city =="Pittsburgh": return 222 else : return 475 def rental_car_cost(days): cost = 40*days if days >= 7 : return cost -50 elif days>=3 : return cost -20 else : return cost def trip_cost(city,days,spending_money): return rental_car_cost(days) + hotel_cost(days) + plane_ride_cost(city)+ spending_money | cs |
역시나 꽤나 고생했던 파트..
'codeacademy' 카테고리의 다른 글
| 13. Battle ship! (0) | 2017.03.28 |
|---|---|
| 11. Student Becomes the Teacher (0) | 2017.03.28 |
| 10. A Day at the Supermarket / Stocking Out (0) | 2017.03.28 |
| 7. Functions / Practice Makes Perfect (0) | 2017.03.28 |
| 파이썬 숫자 맞추기 게임(Guess My Number) (0) | 2017.03.28 |
댓글