读书人

Python 入门教程 七 - PygLatin

发布时间: 2013-10-08 17:02:59 作者: rapoo

Python 入门教程 7 ---- PygLatin


第一节

1 介绍了Python的函数组成有三部份,函数头,函数体

2 函数的举例

from moduleimport function 

3 练习:从math模块里面值导入sqrt函数

from moduleimport *来表示从模块里面导入所有的函数,这样调用的时候就直接调用即可

2 练习:从math模块里面导入所有的方法,然后随便选择一个函数来测试



第十一节

1 介绍了第一个函数max(),比如max(1,2,3)返回的是3 (min函数是类似的)

2 max()函数的参数是一个数组,返回数组中的最大值

3 练习:使用max函数来得到一个数组的最大值

# Print out the types of an integer, a float,# and a string on separate lines below.print type(4)print type(4.2)print type('spam')



读书人网 >perl python

热点推荐