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 — for 循环 | 莫烦Python for 循环 作者: 高峰 编辑: 莫烦 发布于: 2016-01-01 在上一讲中我们学习了 while 语句进行循环控制,接下来我们将要学习另一种循环语句 for 。 基本使用¶不同编程语言都有 for 语言,比如 C# 语言中的 foreach, Java 语言中的 for,在 Python 中的基本使用方法如下。
实例¶输出的结果为 那么每次循环都会输出 进阶¶range使用在 Python 内置了工厂函数, 1 range(start, stop)其中 上述表达将会返回 2 range(stop)如果省略了 3 range(start, stop, step)
将会输出 高级主题¶4.1 内置集合Python 共内置了 tuple 类型程序将以此按行输出 'python', 2.7 和 64。 dictionary 类型输出的结果为: set 类型将会输出 4.2 迭代器Python 中的 将会输出前 5 个 Fibonacci 数据 4.3 生成器除了使用迭代器以外,Python 使用 将会输出前 5 个 Fibonacci 数据 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. |