36

简单的函数实参、形参、默认值的定义-wyz的博客

 6 years ago
source link: http://blog.51cto.com/13595859/2089244
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.
neoserver,ios ssh client
Python语句中可以进行函数调用来简化工作,每个函数都可以完成具体的任务。当遇到相同任务,调用函数方便快捷。函数首先需设定形参(抽象概念),最后赋予具体值(实参),有些具体值可以不变,则可提前设定好默认值。eg.编写一个和T-SHIRT尺码及标语相关的函数:设定好T-SHIRT需输入的形参(尺码及标语),最后赋予具体值defmake_shirt(size,slogan):#size/slogan

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK