首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > perl python >

Python 入门教程 七 - PygLatin

2013-10-08 
Python 入门教程 7 ---- PygLatin 第一节1 介绍了Python的函数组成有三部份,函数头,函数体2 函数的举例fro

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')



热点排行