1.1

Python介绍

1.1.1

Python简介

1.1.2

Python设计哲学与定位

1.1.3

Python应用范围

1.1.4

Python的种类

1.2

Python的语法

1.2.1

缩进语法

1.2.2

变量说明

1.2.3

语句和控制流

<td style="width: 79.7%; border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; border-top-color: #a5a5a5; border-right-color: #a5a5a5; border-bottom-color: #a5a5a5; border-left: none; background: #a5a5a5; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 1;" align="center">
    <strong><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; color: white; mso-themecolor: background1;">说明</span></strong>
  </p>
</td>
<td style="width: 79.7%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">当条件成立时运行语句块。经常与</span><span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">else, elif</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">(相当于</span><span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">else if</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">)配合使用。</span>
  </p>
</td>
<td style="width: 79.7%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">遍列列表、字符串、字典、集合等迭代器,依次处理迭代器中的每个元素。</span>
  </p>
</td>
<td style="width: 79.7%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">当条件为真时,循环运行语句块。</span>
  </p>
</td>
<td style="width: 79.7%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">与</span><span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">except, finally, else</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">配合使用处理在程序运行中出现的异常情况。</span>
  </p>
</td>
<td style="width: 79.7%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">用于定义类型。</span>
  </p>
</td>
<td style="width: 79.7%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">用于定义函数和类型的方法。</span>
  </p>
</td>
<td style="width: 79.7%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">表示此行为空,不运行任何操作。</span>
  </p>
</td>
<td style="width: 79.7%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">用于程序调适阶段时测试运行条件是否满足。</span>
  </p>
</td>
<td style="width: 79.7%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">Python2.6</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">以后定义的语法,在一个场景中运行语句块。比如,运行语句块前加锁,然后在语句块运行结束后释放锁。</span>
  </p>
</td>
<td style="width: 79.7%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">在迭代器函数内使用,用于返回一个元素。自从</span><span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">Python 2.5</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">版本以后。这个语句变成一个运算符。</span>
  </p>
</td>
<td style="width: 79.7%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">抛出一个异常。</span>
  </p>
</td>
<td style="width: 79.7%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="79%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">导入一个模块或包。常用写法:</span><span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">from module import name, import module as name, from module import name as anothername</span>
  </p>
</td>

1.2.4

程序交互

# 将用户输入的内容赋值给 name 变量 name = input("请输入用户名:")

# 打印输入的内容 print(name)

1.2.5

数据类型与动态类型

<td style="width: 47.72%; border-top-width: 1pt; border-top-color: #a5a5a5; border-left: none; border-bottom-width: 1pt; border-bottom-color: #a5a5a5; border-right: none; background: #a5a5a5; padding: 0cm 5.4pt;" width="47%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 1;" align="center">
    <strong><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; color: white; mso-themecolor: background1;">描述</span></strong>
  </p>
</td>

<td style="width: 33.34%; border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; border-top-color: #a5a5a5; border-right-color: #a5a5a5; border-bottom-color: #a5a5a5; border-left: none; background: #a5a5a5; padding: 0cm 5.4pt;" width="33%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 1;" align="center">
    <strong><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman'; color: white; mso-themecolor: background1;">例子</span></strong>
  </p>
</td>
<td style="width: 47.72%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="47%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">一个由字符组成的不可更改的有序列。在</span><span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">Python 3.x</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">里,字符串由</span><span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">Unicode</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">字符组成。</span>
  </p>
</td>

<td style="width: 33.34%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="33%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">'Wikipedia'</span>
  </p>
  
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">"Wikipedia"</span>
  </p>
  
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">"""Spanning</span>
  </p>
  
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">multiple</span>
  </p>
  
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">lines"""</span>
  </p>
</td>
<td style="width: 47.72%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="47%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">一个由字节组成的不可更改的有序列。</span>
  </p>
</td>

<td style="width: 33.34%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="33%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">b'Some ASCII'</span>
  </p>
  
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">b"Some ASCII"</span>
  </p>
</td>
<td style="width: 47.72%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="47%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">可以包含多种类型的可改变的有序列</span>
  </p>
</td>

<td style="width: 33.34%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="33%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">[4.0, 'string', True]</span>
  </p>
</td>
<td style="width: 47.72%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="47%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">可以包含多种类型的不可改变的有序列</span>
  </p>
</td>

<td style="width: 33.34%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="33%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">(4.0, 'string', True)</span>
  </p>
</td>
<td style="width: 47.72%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="47%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">与数学中集合的概念类似。无序的、每个元素唯一。</span>
  </p>
</td>

<td style="width: 33.34%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="33%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">{4.0, 'string', True}</span>
  </p>
  
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">frozenset([4.0, 'string', True])</span>
  </p>
</td>
<td style="width: 47.72%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="47%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">一个可改变的由键值对组成的无序列。</span>
  </p>
</td>

<td style="width: 33.34%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="33%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">{'key1': 1.0, 3: False}</span>
  </p>
</td>
<td style="width: 47.72%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="47%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">精度不限的整数</span>
  </p>
</td>

<td style="width: 33.34%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="33%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">42</span>
  </p>
</td>
<td style="width: 47.72%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="47%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">浮点数。精度与系统相关。</span>
  </p>
</td>

<td style="width: 33.34%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="33%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">3.1415927</span>
  </p>
</td>
<td style="width: 47.72%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="47%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">复数</span>
  </p>
</td>

<td style="width: 33.34%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="33%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph; mso-yfti-cnfc: 64;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">3+2.7j</span>
  </p>
</td>
<td style="width: 47.72%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="47%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">逻辑值。只有两个值:真、假</span>
  </p>
</td>

<td style="width: 33.34%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="33%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">True</span>
  </p>
  
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: justify; text-justify: inter-ideograph;">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">False</span>
  </p>
</td>

1.2.6

运算符

1.3

流程控制语句

1.3.1

流程控制之–if

1.3.2

流程控制之–while循环

</span><span style="color: #008000;">#</span><span style="color: #008000;"> 循环体</span>
 
<span style="color: #008000;">#</span><span style="color: #008000;"> 如果条件为真,那么循环体则执行</span>
<span style="color: #008000;">#</span><span style="color: #008000;"> 如果条件为假,那么循环体不执行</span></pre>

1.3.3

格式化输出

1.4

编码说明

<td style="width: 20%; border-top-width: 1pt; border-top-color: #a5a5a5; border-left: none; border-bottom-width: 1pt; border-bottom-color: #a5a5a5; border-right: none; background: #a5a5a5; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 1;" align="center">
    <strong><span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体; color: white; mso-themecolor: background1;" lang="EN-US">ASCII</span></strong>
  </p>
</td>

<td style="width: 20%; border-top-width: 1pt; border-top-color: #a5a5a5; border-left: none; border-bottom-width: 1pt; border-bottom-color: #a5a5a5; border-right: none; background: #a5a5a5; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 1;" align="center">
    <strong><span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体; color: white; mso-themecolor: background1;" lang="EN-US">Unicode</span></strong>
  </p>
</td>

<td style="width: 20%; border-top-width: 1pt; border-top-color: #a5a5a5; border-left: none; border-bottom-width: 1pt; border-bottom-color: #a5a5a5; border-right: none; background: #a5a5a5; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 1;" align="center">
    <strong><span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体; color: white; mso-themecolor: background1;" lang="EN-US">utf-8</span></strong>
  </p>
</td>

<td style="width: 20%; border-top-width: 1pt; border-right-width: 1pt; border-bottom-width: 1pt; border-top-color: #a5a5a5; border-right-color: #a5a5a5; border-bottom-color: #a5a5a5; border-left: none; background: #a5a5a5; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 1;" align="center">
    <strong><span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体; color: white; mso-themecolor: background1;" lang="EN-US">GBK</span></strong>
  </p>
</td>
<td style="width: 20%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 64;" align="center">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">1</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">个字节</span>
  </p>
</td>

<td style="width: 20%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 64;" align="center">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">2-4</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">个字节</span>
  </p>
</td>

<td style="width: 20%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 64;" align="center">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">1</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">个字节</span>
  </p>
</td>

<td style="width: 20%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 64;" align="center">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">1</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">个字节</span>
  </p>
</td>
<td style="width: 20%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center;" align="center">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">x</span>
  </p>
</td>

<td style="width: 20%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center;" align="center">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">2-4</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">个字节</span>
  </p>
</td>

<td style="width: 20%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center;" align="center">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">3</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">个字节</span>
  </p>
</td>

<td style="width: 20%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center;" align="center">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">2</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">个字节</span>
  </p>
</td>
<td style="width: 20%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 64;" align="center">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">x</span>
  </p>
</td>

<td style="width: 20%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 64;" align="center">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">2-4</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">个字节</span>
  </p>
</td>

<td style="width: 20%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 64;" align="center">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">2</span><span style="font-size: 10.0pt; font-family: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 'Times New Roman';">个字节</span>
  </p>
</td>

<td style="width: 20%; border-top: none; border-left: none; border-bottom-width: 1pt; border-bottom-color: #c9c9c9; border-right-width: 1pt; border-right-color: #c9c9c9; background: #ededed; padding: 0cm 5.4pt;" width="20%">
  <p class="MsoNormal" style="margin-bottom: .0001pt; text-align: center; mso-yfti-cnfc: 64;" align="center">
    <span style="font-size: 10.0pt; font-family: 'Times New Roman',serif; mso-fareast-font-family: 宋体;" lang="EN-US">x</span>
  </p>
</td>

1.5

参考文献

<li>
  <a href="#12_Python">1.2 Python的语法</a><ul>
    <li>
      <a href="#121">1.2.1 缩进语法</a>
    </li>
    <li>
      <a href="#122">1.2.2 变量说明</a>
    </li>
    <li>
      <a href="#123">1.2.3 语句和控制流</a>
    </li>
    <li>
      <a href="#124">1.2.4 程序交互</a>
    </li>
    <li>
      <a href="#125">1.2.5 数据类型与动态类型</a>
    </li>
    <li>
      <a href="#126">1.2.6 运算符</a>
    </li>
  </ul>
</li>

<li>
  <a href="#13">1.3 流程控制语句</a><ul>
    <li>
      <a href="#131_--if">1.3.1 流程控制之--if</a>
    </li>
    <li>
      <a href="#132_--while">1.3.2 流程控制之--while循环</a>
    </li>
    <li>
      <a href="#133">1.3.3 格式化输出</a>
    </li>
  </ul>
</li>

<li>
  <a href="#14">1.4 编码说明</a>
</li>
<li>
  <a href="#15">1.5 参考文献</a>
</li>