51

函数-Sweltering的博客-51CTO博客

 6 years ago
source link: http://blog.51cto.com/13502869/2068557
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
函数函数的定义函数:通俗讲就是功能,将一个功能进行封装打包,下次使用直接调用这个功能就可以了,不用进行重复定义。函数的特点:1、减少冗余代码2、保持代码的一致性3、代码的结构比较清晰函数定义的结构:def函数名(参数):函数功能内容结构解析:1、关键字:def2、函数名命名规则a)字母开头b)不允许有关键字c)不允许有特殊符号d)函数名起名要见名生意3、参数:定义在括号里面,由调用时传入,可以有参

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK