Python学习笔记(3)——Taking a Vacation
来源:互联网 发布:算法导论适合初学者吗 编辑:程序博客网 时间:2024/06/13 22:37
5.
def hotel_cost(nights): return 140 * nightsdef plane_ride_cost(city): if city == "Charlotte": return 183 if city == "Tampa": return 220 if city == "Pittsburgh": return 222 if city == "Los Angeles": return 475def rental_car_cost(days): cost = 40 * days if days >= 7: cost -=50 elif days <7 and days >= 3: cost -=20 return costdef trip_cost(city,days): return rental_car_cost(days)+hotel_cost(days)+plane_ride_cost(city)
6. 7.
def trip_cost(city,days,spending_money): return rental_car_cost(days)+hotel_cost(days)+plane_ride_cost(city)+spending_moneyprint trip_cost("Los Angeles",5,600)
阅读全文
0 0
- Python学习笔记(3)——Taking a Vacation
- UVa 10192—Vacation
- 行人检测论文笔记:Taking a Deeper Look at Pedestrians
- Taking a shower
- Python学习笔记(—):初识python
- Python学习笔记(5)——A Day at the Supermarket
- Taking Photos Simply笔记
- Cyprus, a European vacation garden
- Methods of taking a snapshot
- Vacation
- vacation
- Python学习笔记——从CF A题开始(input.split(),raw_input.split()+list用法)
- Python学习笔记(六)— 函数
- Python学习笔记(3)——逻辑关系
- python学习笔记(3)——循环
- Python学习笔记——Python中的基本语法3
- 【Python】学习笔记——-3、安装Python
- [Python]python学习笔记(一)——语法
- [bzoj2820]YY的GCD 莫比乌斯反演
- qq第三方登陆和回传头像
- 自定义View,创建一个小圆点,单击可以拖动
- libmali-xlnx_git.bb:do_fetch) failed with exit code '1'
- Android Studio之通过AndroidManifes.xml添加权限
- Python学习笔记(3)——Taking a Vacation
- MyBatis jdbcType类型
- 爬动的蠕虫
- hdu 6070 二分答案+线段树
- C++虚函数,纯虚函数的继承
- Libigl实现CPU间的并行
- 84. Largest Rectangle in Histogram
- Leveldb实现原理
- RDD理解及宽依赖和窄依赖