Python Exercise #19
2013-06-02 12:34
134 查看
#!/usr/bin/python # exact position of python #!/usr/bin/env python # position of python in enviornment # -*- coding:utf-8 -*- # coding # Purpose: Functions and Variables def cheese_and_crackers(cheese_count, boxes_of_crackers): print "You have %d cheeses!" % cheese_count print "You have %d boxes of crackers!" % boxes_of_crackers print "Man that's enough for a party!" print "Get a blanket.\n" print "We can just give the function numbers directly:" cheese_and_crackers(20,30) print "OR, we can use variables from our script:" amount_of_cheese = 10 amount_of_crackers = 50 cheese_and_crackers(amount_of_cheese, amount_of_crackers) print "We can even do math inside too:" cheese_and_crackers(10 + 20, 5 + 6) print "And we can combine the two, variables and math:" cheese_and_crackers(amount_of_cheese + 100, amount_of_crackers + 1000)
相关文章推荐
- Python学习之旅-19
- Leetcode 19. Remove Nth Node From End of List(python)
- Python学习19:其他应用(列表综合、列表或元组作为函数参数、lambda形式)
- Python Qt GUI快速编程-第五章的exercise的python3+pytq5+Qt Dersinger实现
- Exercise(19):排列2
- 我的第一个python web开发框架(19)——产品发布相关事项
- 学习 Python 编程的 19 个资源
- python3基础 -19 logging
- 我与python约个会:19. 再说函数~那些不得不知道的事儿
- python 代码片段19
- 19-python_文件和目录
- Deep Learning 19_深度学习UFLDL教程:Convolutional Neural Network_Exercise(斯坦福大学深度学习教程)
- Python学习笔记(19)-账户管理器Version2.0
- 笨办法学python习题19 函数和变量
- LeetCode 19. Remove Nth Node From End of List (Python)
- python 爬虫抓取19楼租房信息
- Python 3基础教程19-模块导入语法
- python基础教程_学习笔记19:标准库:一些最爱——集合、堆和双端队列
- Learn Python The Hard Way学习(19) - 函数和变量
- python学习笔记(19)--PTVS的安装