GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing mofanpy.com — def 函数 | 莫烦Python def 函数 作者: 高峰 编辑: 莫烦 发布于: 2016-01-01 如果我们用代码实现了一个小功能,但想要在程序代码中重复使用,不能在代码中到处粘贴这些代码,因为这样做违反 了软件工程中 DRY原则。 Python 提供了 函数功能,可以将我们这部分功能抽象成一个函数以方便程序调用,或者提供给其他模块使用。 基本使用¶Python 使用 实例¶上面我们定义了一个名字为 如果我们想要在脚本中调用的脚本,只需要在脚本中最后添加函数调用语句 那么在执行脚本的时候,将会执行函数。 Python基础
安装
基本使用
if 判断
变量形式
模块安装
class 类
input 输入
元组, 列表, 字典 |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |