Python 全套教程 学习笔记

Python 全套教程 学习笔记

  • Python 全套教程 学习笔记

    • print()函数
    • 转义字符
    • 二进制与字符编码
    • Python中的标识符和保留字
    • 变量的定义和使用
    • 数据类型
    • 数据类型转换
    • Python中的注释
    • input()输入函数
    • Python中的运算符
    • 程序的组织结构
    • 列表
      • 列表的查询操作
      • 列表元素的增加操作
      • 列表元素的删除操作
      • 列表元素的修改操作
      • 列表元素的排序操作
      • 列表生成的公式
    • 字典
      • 什么是字典
      • 字典的原理
      • 字典的创建与删除
      • 字典的常用操作
      • 获取字典视图的三个方法
      • 字典元素的遍历
      • 字典的特点
      • 字典生成式
    • 元组
      • 元组的创建方式
      • 为什么要将元组设计成不可变序列
      • 元组的遍历
    • 集合
      • 集合的创建方式
      • 集合元素的判断操作
      • 集合元素的新增操作
      • 集合元素的删除操作
      • 集合间的关系
        • 两个集合是否相等
        • 一个集合是否是另一个集合的子集合
        • 一个集合是否是另一个集合的超集
        • 两个集合是否没有交集
      • 集合的数学操作
        • 交集 intersection()
        • 并集 union()
        • 差集 difference()
        • 对称差集 symmetric_difference()
      • 集合生成式
      • 总结列表、字典、元组、集合
    • 字符串
      • 字符串的驻留机制
      • 字符串驻留机制的优缺点
      • 字符串的查询操作方法
        • index()
        • rindex()
        • find()
        • rfind()
      • 字符串的大小写转换操作方法
        • upper()
        • lower()
        • swapcase()
        • capitalize()
        • title()
      • 字符串内容对齐操作
        • center()
        • ljust()
        • rjust()
        • zfill()
      • 字符串劈分操作
        • split()
        • rsplit()
      • 字符串判断操作
        • isidentifier()
        • isspace()
        • isalpha()
        • isdecimal()
        • isnumeric()
        • isalnum()
      • 字符串其他的操作方法
        • replace()
        • join()
      • 字符串的比较操作
      • 字符串的切片操作
      • 格式化字符串
      • 字符串的编码转换
    • 函数
      • 函数的创建和调用
      • 函数的参数传递
      • 函数的参数定义
      • 函数的参数总结
      • 变量的作用域
        • 定义函数
        • 递归函数
    • 异常处理
      • try-except 结构
      • try-except-else 结构
      • try-except-else-finally 结构
      • Python 常见的异常类型
      • traceback 模块打印异常信息
    • 调试
    • 编程思想
    • 类与对象
      • 创建类
      • 类的实例化
      • 类属性
      • 类方法
      • 静态方法
      • 动态绑定属性和方法
      • 封装
      • 继承
      • 方法重写
      • object类
      • 多太
      • 特殊方法和特殊属性
      • 变量赋值操作
      • 浅拷贝
      • 深拷贝
    • 模块
      • 什么是模块
      • 自定义模块
      • 导入模块
      • 以主程序形式运行
      • Python 中常用的内置模块
      • 第三方模块的安装及使用
      • 知识总结
    • 文件目录
      • 编码格式
      • 文件读写原理
      • 文件读写操作
      • 文件对象常用方法
      • with语句(上下文管理器)
      • 目录操作
      • 知识总结
    • 其他知识
      • 项目打包

print()函数

  • 输出数字、字符串、含运算符的表达式
print(520)print('Hello world')print('Hello world')print(3 1)#将数据输出文件中fp=open('d:/text.txt','a ') #a 如果文件不存在就创建,存在就在文件内容的后面继续追加print('Hello world',file=fp)fp.close()#逗号,不进行换行输出(输出内容在一行当中)print('Hello','World','Python')

转义字符

  • 什么是转移字符?

    • 反斜杠 想要实现的转移功能首字母。
  • 为什么需要转移字符?
    • 当字符串中包含反斜杠、单引号和双引号等有特殊用途的字符时,必须使用反斜杠对这些字符进行转义(转换一个含义)

      • 反斜杠:\
      • 单引号:'
      • 双引号:'
    • 当字符串中包含换行、回车,水平制表符或退格等无法直接表示的特殊字符时,也可以使用转义字符当字符串中包含换行、回车,水平制表符或退格等无法直接表示的特殊字符时,也可以使用转义字符
      • 换行:\n
      • 回车:\r
      • 水平制表符:\t
      • 退格:\b
print('Hello\nworld')print('Hello\tworld')print('Hello\bworld')print('http:\\\\www.baidu.com')print('老实说:\'大家好\'')#原字符,让字符串中的转移字符不起作用print(r'Hello\nworld')

二进制与字符编码

print(chr(0b100111001011000)) #0b表示二进制print(ord('乘'))

Python中的标识符和保留字

变量的定义和使用

name='马丽亚'print(name)print('标识',id(name))print('类型',type(name))print('值',name)

数据类型

针对浮点类型(float)存储不精确的问题,解决方案是:导入模块 decimal

from decimal import Decimalprint(Decimal('1.1') Decimal('2.2')) #不会出现小数位不精确的情况了

布尔型(bool)可以转换成整数型

print(True 1)

字符串类型可以使用单引号、双引号、三引号定义,其中:单引号、和双引号定义的字符串必须在一行,三引号的字符串可以分布在连续的多行

str4='''人生苦短我用Python'''

数据类型转换

name='张三'age=20print(type(name),type(age))print('我叫' name ',今年' str(age) '岁。') #将 int 类型通过 str() 转换成字符串类型。

Python中的注释

input()输入函数

作用:接收来自用户的输入
返回值类型:输入值的类型为str
值的存储:使用=对输入的值进行存储

present=input('大圣想要什么礼物呢?')a=input('请输入一个加数:') #输入的数字为str类型的a=int(a) #对输入的数据转换b=input('请输入另一个加数:') #输入的数字为str类型的b=int(b) #对输入的数据转换print(a b)#第二种方式实现a=int(input('请输入一个加数:'))b=int(input('请输入另一个加数:'))

Python中的运算符

#取余运算符print(11%2) #等于1,余数是1#幂运算符print(2**2) #表示 2 的 2 次方print(2**3) #表示 2 的 3次方,也就是 2*2*2 = 8
#赋值运算符举例a=20a =30print(a) #结果是50,相当于 a 30#解包赋值举例a,b,c=20,30,40 #左右个数需一致#比较运算符的结果为bool类型,比较的是值# is 标识比较符print('a>b吗?',a>b) # Falseprint(a==b) # True 表示 a 与 b 的 value 相等print(a is b) # True 表示 a 与 b 的 id标识相等print(a is not b) # False id标识符不相等# in 与 not in 比较符s='helloworld'print('w' in s) #Trueprint('k' in s) #Falseprint('w' not in s) #Falseprint('k' not in s) #True
print(4&8) #按位与&,同为1时结果为1print(4|8) #按位或|,同为0时结果为0print(4<<1) #向左移动1位,相当于 乘以 2print(4>>2) #向右移动2位,相当于 除以 4

程序的组织结构

三种基本结构组成:顺序结构选择结构循环结构
Python一切皆对象,所有对象都有一个布尔值

# 单分支结构money=1000s=int(input('请输入取款金额:'))if money>=s: money=money-s print('取款成功,余额为:',money)# 双分支结构if money>=s: money=money-s print('取款成功,余额为:',money)else: print('余额不足')# 多分支结构score=int(input('请输入一个成绩:'))if score>=90 and score<=100: print('A级')elif score>=70 and score<=89: print('B级')elif score>=60 and score<=69: print('C级')elif score>=0 and score<=59: print('D级')else: print('对不起,成绩输入有误。')# 还可以用下面语法表达if 90<=score<=100: print('A级')elif 70<=score<=89: print('B级')elif 60<=score<=69: print('C级')elif 0<=score<=59: print('D级')else: print('对不起,成绩输入有误。')# 使用条件表达式进行比较a=10b=20print(str(a) '大于等于' str(b) if a>=b else str(a) '小于' str(b))# pass语句,什么都不做,只是一个占位符,用到需要写语句的地方,用于前期搭建代码结构的地方if answer=='y': passelse: pass# while 循环a=1while a<10: print(a) a =1# for-in 循环for item in 'python': print(item)# break 语句,用于结束循环结构,通常与分支结构 if 一起使用# continue 语句,用于结束当前循环,进入下一个循环,通常与分支结构 if 一起使用
  • else 与语句
  • 与 else 语句配合使用的三种情况为:if-else \ while-else \ for-else

列表

  • 列表需要使用中括号[],元素间用英文逗号分隔
lst=['hello','world',98]
  • 创建列表第二种方式,使用内置函数 list()
lst2=(['hello','world',98])

列表的特点
列表元素按顺序有序排序
索引映射唯一个数据
列表可以存储重复数据
任意数据类型混存
根据需要动态分配和回收内存

列表的查询操作

  • 获取列表中指定元素的索引 index()
  1. 查询列表中存在N个相同元素,只返回相同元素中的第一个元素的索引
  2. 如果查询的元素在列表中不存在,则会抛出ValueError
  3. 还可以在指定的 start 和 stop 之间进行查询
lst=['hello','world',89,'hello']print(lst.index('hello')) #如果存在相同元素,只返回相同元素第一个元素的索引print(lst.index('python')) #抛出 IndexError 错误print(lst.index('hello',1,3)) #指定范围内,查找索引 1 和 2
  • 获取列表中的单个元素
  1. 正向索引从1到N-1 举例:lst[0]
  2. 逆向索引从-N到-1 举例:lst[-N]
  3. 指定索引不存在,抛出 IndexError
lst=['hello','world',98,'hello','world',234]print(lst[2]) #获取索引为2的元素print(lst[-3]) #逆向获取索引为-3的元素
  • 获取列表中的多个元素
    语法格式
    列表名 [ start : stop : step ]
#start stop step 为空时默认为 0、最大索引、1print(lst[::1]) #正向stepprint(lst[::-1]) #逆向step
  • 判断指定元素在列表中是否存在 in 、not in
    语法格式
    元素 in 列表名
    元素 not in 列表名
print(10 in lst)print(10 not in lst)
  • 遍历列表元素 for-in
    语法格式
    for 迭代变量 in 列表名:
for item in lst:    print(item)

列表元素的增加操作

lst.append(100) #在列表末尾添加一个元素lst.extend(lst2) #在列表末尾至少添加一个元素lst.insert(1,90) #在列表的任意位置添加一个元素lst[1:]=lst3 #在列表的任务位置添加至少一个元素,从索引1往后的元素切掉,lst3替换进来

列表元素的删除操作

lst.remove(30) #删除一个元素,如果有重复元素,只删除第一个元素,如果元素不存在则抛错 ValueErrorlst.pop(1) #删除索引为1的元素lst.pop(5) #删除索引为5的元素,如果指定的索引位置不存在将抛错,如果不指定参数则删除列表最后一个元素lst[1:3]=[] #切片,将当前列表的1到3索引的元素通过传入空的方式删除lst2=lst[1:3] #切片,产生新的列表,原列表不改变lst.clear() #删除列表中所有元素del lst #删除列表对象

列表元素的修改操作

  • 为指定索引的元素赋予新值
lst[2]=100 #修改索引2的元素值为100
  • 为指定的切片赋予新值
lst[1:3]=[300,400,500,600]

列表元素的排序操作

  • 调用 sort() 方法,列表中的所有元素默认按照从小到大的顺序排序,可以指定 reverse=True,进行降序排序
lst.sort()lst.sort(reverse=True)
  • 调用内置函数 sorted(),可以指定 reverse=True,进行降序排序,原列表不发生改变
lst2=sorted(lst) #函数产生新的列表对象lst3=sorted(lst,reverse=True)

列表生成的公式

语法格式

# [ i*i for i in range(1,10) ]#注意事项:“表示列表元素的表达式”中通常包含自定义变量lst=[i for i in range(1,10)] #产生1到9的列表lst=[i*2 for i in range(1,10)] #产生2,4、6、8、10的列表

字典

什么是字典

Python 内置的数据结构之一,与列表一样是一个可变序列
以键值对的方式存储数据,字典是一个无序的序列

字典的原理

字典以大括号表示

scores={ '张三':100,'李四':98,'王五':45 }
  • 字典的实现原理与查字典类似,查字典是先根据部首或拼音查找对应的页码,Python 中的字典是根据 key 查找 value 所在的位置。

字典的创建与删除

  • 字典的创建
scores={ '张三':100,'李四':98,'王五':45 }
  • 使用内置函数 dict()
dict(name='jack',age=20)

字典的常用操作

  • 获取字典中的元素
  1. [] 举例:scores['张三']
  2. get() 方法 举例:scores.get('张三')
print(scores['张三']) #如果找不到,则会抛错print(scores.get('张三')) #如果找不到,则不会抛错,返回 Noneprint(scores.get('张三','默认值')) #如果找不到,提供默认值
  1. key 的判断 in 、not in
print('张三' in scores)print('张三' not in scores)
  1. 元素删除操作
del scores['张三'] #删除指定的 key-value 对

5.清空字典的元素

scores.clear()
  1. 字典元素的新增
scores['Jack']=90
  1. 字典元素的修改
scores['Jack']=70

获取字典视图的三个方法

  1. keys() 获取字典中所有 key
  2. values() 获取字典中所有 value
  3. items() 获取字典中所有 key,value 对
  4. 将字典转换成列表
items=scores.items()list(items)

字典元素的遍历

for item in scores:    print(item,scores[item],scores.get(item)) #scores[item] 会抛错,scores.get(item) 不会

字典的特点

字典中的所有元素都是一个 key-value 对,key 不允许重复,value 可以重复
字典中的元素是无序的
字典中的 key 必须是不可变对象
字典也可以根据需要动态滴伸缩
字典会浪费较大的内存,是一种使用空间换时间的数据结构

字典生成式

  • 内置函数 zip()
    用于将可迭代的对象作为参数,将对象中对应的元素打包成一个元组,然后返回由这些元组组成的列表
items=['Fruits','Books','Others']prices=[96,78,85]lst=zip(items,prices)print(list(lst))d={item.upper():price for item,price in zip(items,prices)} #如果键值对数量不匹配,以数量少的一方展示

元组

Python 内置的数据结构之一,是一个不可变序列
不可变序列和可变序列
不可变序列:字符串、元组,没有增、删、改操作
可变序列:列表、字典,可以对序列执行增、删、改操作,对象地址不发生更改

元组的创建方式

  • 直接小括号
t=( 'Python','Hello', 90 )
  • 使用内置函数 tuple()
t=tuple(( 'Python','Hello', 90 ))
  • 只包含一个元祖的元素需要使用逗号和小括号
t=(10, )
  • 可以简写为
t='Python','Hello', 90
  • 空元组的创建
t=()t=tuple()

为什么要将元组设计成不可变序列

  • 在多任务环境下,同时操作对象时不需要加锁,因此在程序中尽量使用不可变序列
  • 注意事项:元组中存车处的是对象的引用
    1. 如果元组中对象本身不可对象,则不能再引用其他对象
    2. 如果元组中的对象是可变对象,则可变对象的引用不允许改变,但数据可以改变

元组的遍历

  • 元组是可迭代对象,使用可以使用 for-in 遍历
t=tuple('Python','hello',90)for item in t: print(item)

集合

  • Python 语言提供的内置数据结构
  • 与列表、字典一样都属于可变类型的序列
  • 集合是没有 value 的字典

集合的创建方式

  • 直接{}
s={ 'Python','hello',90 }
  • 使用内置函数 set()
s={ 2,3,4,4,5,5,6,7,7 } #集合中的元素不允许重复(与字典相同)s=set(range(6))print(s)print(set([3,4,53,56])) #将列表转换成集合print(set([3,4,43,435])) #将元组转换成集合,元素是无序的print(set('Python')) #将字符串转换为集合,按字母序列,无序print(set({124,3,4,4,5})) #集合print(set()) #空集合

集合元素的判断操作

  • in 或 not in
s={10,20,30}print(10 in s) #Trueprint(10 not in s) #False

集合元素的新增操作

  • 调用 add() 方法,一次添加一个元素
  • 调用 update() 方法,至少添加一个元素
s.add(40) #添加一个元素s.update({60,70,80}) #添加多个元素# update() 里还可以放元组、列表

集合元素的删除操作

  • 调用 remove() 方法,一次删除一个指定元素,如果指定元素不存在则抛出 KeyError
  • 调用 discard() 方法,一次删除一个指定元素,如果指定元素不存在则不会抛出异常
  • 调用 pop() 方法,一次删除一个任意元素
  • 调用 clear() 方法,清空集合
s.remove(10)s.remove(500) #报错s.discard(500) #不会报错s.pop() #删除任意元素,随机的删除一个元素,该方法无参数s.clear() #清空集合

集合间的关系

两个集合是否相等

  • 可以使用运算符 == 或 != 判断
s1={1,2,3}s2={3,2,1}print(s1==s2) #Trueprint(s1!=s2) #False

一个集合是否是另一个集合的子集合

  • 可以调用方法 issubset 判断
  • B 是 A 的子集
s1={1,2,3}s2={3,2,1}s3={1,2,5,6}print(s2.issubset(s1)) #Trueprint(s3.issubset(s1)) #False

一个集合是否是另一个集合的超集

  • 可以调用方法 issuperset 判断
  • A 是 B 的超集
print(s1.issuperset(s2)) #Trueprint(s3.issuperset(s2)) #False

两个集合是否没有交集

  • 可以调用方法 isdisjoint 判断
print(s2.isdisjoint(s3)) #False 有交集为 Falses4={100,200,300}print(s2.isdisjoint(s4)) #True 没有交集为 True

集合的数学操作

交集 intersection()

s1={1,2,3,4,5}s2={3,4,5,6,7}print( s1.intersection(s2) ) #执行结果为 {3,4,5}#简写为print(s1 & s2)

并集 union()

print(s1.union(s2)) #执行结果为 {1,2,3,4,5,6,7} ,去掉了重复的元素#简写为print(s1 | s2)

差集 difference()

print(s1.difference(s2)) #执行结果为 {1,2}#简写为print(s1-s2)

对称差集 symmetric_difference()

print(s1.symmetric_difference(s2)) #执行结果为 {1,2,6,7}#简写为print(s1^s2)

集合生成式

s={i*i for i in range(10)}print(s)

总结列表、字典、元组、集合

字符串

字符串的驻留机制

  • 字符串

  • 在 Python 中字符串是基本数据类型,是一个不可变的字符序列

  • 什么叫字符串驻留机制呢?

  • 仅保存一份相同且不可变字符串的方法,不同的值被存放在字符串的主流池中,Python 的主流机制对相同的字符串只保留一份拷贝,后续创建相同字符串时,不会开辟新空间,而是把该字符串的地址赋给新创建的变量

  • 驻留机制的集中情况(交互模式)

  1. 字符串的长度为 0 或 1 时

    • 两个变量要么为空 0,要么字符串一样时 1
  2. 符合标识符的字符串
    • 例如%不符合标识符,所以类似 abc% 的字符串创建两个,为两个id地址的字符串,即内容一样地址不一样
  3. 字符串只在编译时进行主流,而非运行时
a='abc'b='ab' 'c'c=''.join(['ab','c'])print(a is b) #True a 和 b 是编译时创建的,地址相同print(a is c) #False c 是运行时计算的,新开辟的内存空间
  1. [-5,265] 之间的整数数字
a=-5b=-5print(a is b) #True 在整数数字区间内a=-6b=-6print(a is b) #False 不在整数数字区间内
  • sys 中的 intern 方法强制2个字符串指向同一个对象
import sysa='abc%'a='abc%'print(a is b) #False 不符合标识符的不驻留a=sys.intern(b)print(a is b) #True 强制驻留
  • PyCharm 对字符串进行了优化处理

字符串驻留机制的优缺点

  • 当需要值相同的字符串时,可以直接从字符串池中拿来使用,避免频繁创建和销毁,提升效率和节约内存,因此拼接字符串和修改字符串是回比较影响性能的
  • 在需要进行字符串拼接时建议使用 str 类型的 join 方法,而非 ,因为 join() 方法是先计算出所有字符中的长度,然后再拷贝,只 new 一次对象,效率比 效率高

字符串的查询操作方法

index()

  • 从左往右查第一个字符串,如果没找到则抛错

rindex()

  • 从右往左查第一个字符串,如果没找到则抛错

find()

  • 从左往右查第一个字符串,如果没找到则返回 -1

rfind()

  • 从右往左查第一个字符串,如果没找到则返回 -1

提示:日常操作中尽可能使用 find() 和 rfind()

字符串的大小写转换操作方法

upper()

  • 把字符串中所有字符都转成大写字母

lower()

  • 把字符串中所有字符都转成小写字母

swapcase()

  • 把字符串中所有大写字母转成小写字母,把所有小姐字母转成大写字母
print('Hello,world'.swapcase()) # hELLO,WORLD

capitalize()

  • 把第一个字符转成大写,把其余字符转成小写
print('Hello'.capitalize()) # Hello

title()

  • 把每个单词的第一个字符转成大写,把每个单词的剩余字符转成小写
print('Hello world'.swapcase()) # Hello World

字符串内容对齐操作

center()

ljust()

rjust()

zfill()

  • 右对齐,使用0进行填充

字符串劈分操作

split()

  • 从字符串左边开始劈分,默认的劈分字符是空格字符串,返回的值都是一个列表
  • 以通过参数 sep 指定劈分字符串是的劈分符
  • 通过参数 maxsplit 指定劈分字符串时的最大劈分次数,在经过最大次劈分后,剩余的子串会单独作为一部分

rsplit()

  • 从字符串右边开始劈分,默认的劈分字符是空格字符串,返回的值都是一个列表
  • 以通过参数 sep 指定劈分字符串是的劈分符
  • 通过参数 maxsplit 指定劈分字符串时的最大劈分次数,在经过最大次劈分后,剩余的子串会单独作为一部分

字符串判断操作

isidentifier()

  • 判断指定的字符串是否合法标识符

isspace()

  • 判断指定的字符串是否全部由空白字符组成

isalpha()

  • 判断指定的字符串是否全部由字母组成

isdecimal()

  • 判断指定字符串是否全部由十进制的数字组成

isnumeric()

  • 判断指定的字符串是否全部由数字组成

isalnum()

  • 判断指定字符串是否全部由字母和数字组成

字符串其他的操作方法

replace()

  • 字符串替换

join()

  • 字符串合并

字符串的比较操作

  • 运算符 > >= < <= == !=

字符串的切片操作

  • 字符串切片后都将产生新的内存对象

格式化字符串

name='张三'age=20print('我叫%s,今年%d岁' % (name,age))print('我叫{0},今年{1}岁'.format(name,age))print(f'我叫{name},今年{age}岁')print('%10d' % 99) # 10表示宽度print('%.3f' % 3.1415926) # 表示精度,保留3位小数print('{0:.3f}'.format(3.1415926)) #表示精度,保留3位小数print('{0:.3}'.format(3.1415926)) #表示一共是3位数print('%10.3f' % 3.1415926) #同时表示宽度、精度print('{0:10.3f}'.format(3.1415926)) #同时表示宽度、精度

字符串的编码转换

函数

函数的创建和调用

  • 函数就是执行特定任何以完成特定功能的一段代码
  • 为什么需要函数
    1. 服用代码
    2. 隐藏实现细节
    3. 提高可维护性
    4. 提高可读性便于调试
#创建函数def calc(a,b): # 形参,形式参数 c=a b return cresult=calc(10,20) #实参,实参的位置是函数的调用处print(result)

函数的参数传递

  • 两种传递方式
  • 位置实参:根据形参对应的位置进行实参传递
  • 关键字实参:根据形参名称进行实参传递
#位置实参def calc(a,b):calc(10,20)#关键字实参def calc(b=20,a=10):calc(10,20)
  • 参数传递内存分析图

  • 函数返回多个值时,结果为元组

# 1.无返回值的函数,不用写 returndef fun1(): print('hello')# 2.有1个返回值的函数,返回类型为原类型,示例中返回的是 strdef fun2(): return 'hello'res=fun2()# 3.返回多个值,返回类型为元组def fun3(): return 'hello','world'print(fun3())# 函数在定义时,是否需要返回值,视情况而定

函数的参数定义

  • 函数定义默认值参数
  • 给形参设置默认值,只有与默认值不符的情况才需要传递实参
def fun(a,b=100):    print(a,b)fun(100) # 当没有给参数 b 传值时,b 默认值 100fun(20,30)
  • 个数可变的位置参数
  • 定义函数时,可能无法实现确定传递的位置实参的个数时,使用可变的位置参数
  • 使用 * 定义个数可变的位置形参
  • 结果为一个元组
# 定义可变的位置参数def fun(*args): print(args)# 调用函数,传入不同个数的参数,输出的是元组fun(10)fun(10,30)fun(10,30,50)
  • 个数可变的关键字形参
  • 定义函数时,无法事先确定传递的关键字实参的个数时,使用可变的关键字形参
  • 使用 ** 定义个数可变的关键字形参
  • 结果为一个字典
def fun1(**args):    print(args)fun1(a=10) # 结果为字典类型,{'a':10}fun1(a=20,b=30,c=40)  # 结果为字典类型,{'a:20,'b':30,'c':40}
  • 在函数定义参数时,两种类型的参数只能各自定义一个
  • 但两个类型的参数可以同时出现在一个函数参数内,但顺序是个数可变的位置参数定义在前,个数可变的关键字形参定义在后
# 第一个参数为可变的位置参数,第二个参数为可变的关键字参数def fun3(*args1,**args2):

函数的参数总结

变量的作用域

定义函数

  • 局部变量

    • 在函数内定义并使用的变量,只在函数内部游逍,局部变量使用 global 声明,这个变量就会变成全局变量
  • 全局变量
    • 函数体外定义的变量,可作用于函数内外
def fun(a,b):   # a , b 为函数的形参    c=a b   # c 局部变量    print(c)name='杨老师'  # name 全局变量def fun2():    print(name)def fun3():    global age  # 在函数体内定义的全局变量    age = 20    print(age)fun3()print(age)  #在外部也可以访问该变量

递归函数

  • 如果在一个函数的函数体内调用了该函数本身,这个函数成为递归函数
  • 递归调用与递归终止条件
  • 每递归调用一次函数,都会在栈内存分配一个栈帧
  • 每执行完一次函数,都会释放响应的空间
  • 缺点:占用内存多,效率低下
  • 有点:思路和代码简单
def fac(n): if n==1: return 1 else: return n*fac(n-1) print(fac(6))

异常处理

try-except 结构

try:    a=int(input('请输入第一个整数:'))    b=int(input('请输入第二个整数:'))    result=a/b    print('结果为:',result)except ZeroDivisionError:   #捕获为零的异常    print('除数不允许为0')except ValueError:  #捕获值类型异常    print('请输入数字')except BaseException as e:   # 最后写上这个可以捕获遗漏的、其他的异常    print('捕获其他异常错误',e)print('程序结束')

try-except-else 结构

try: a=int(input('请输入第一个整数:')) b=int(input('请输入第二个整数:')) result=a/bexcept ZeroDivisionError: #捕获为零的异常 print('除数不允许为0')except ValueError: #捕获值类型异常 print('请输入数字')except BaseException as e: # 最后写上这个可以捕获遗漏的、其他的异常 print('捕获其他异常错误',e)else: print('结果为:',result)print('程序结束')

try-except-else-finally 结构

try:    a=int(input('请输入第一个整数:'))    b=int(input('请输入第二个整数:'))    result=a/bexcept ZeroDivisionError:   #捕获为零的异常    print('除数不允许为0')except ValueError:  #捕获值类型异常    print('请输入数字')except BaseException as e:   # 最后写上这个可以捕获遗漏的、其他的异常    print('捕获其他异常错误',e)else:    print('结果为:',result)finally:    print('程序结束') #无论 except 还是 else 都会执行到这里

Python 常见的异常类型

traceback 模块打印异常信息

  • 获取异常信息,用于后续对异常的记录log日志之类的操作

调试

  • 断点
  • 程序运行到此处,暂时挂起,停止执行。此事可以详细观察程序的运行情况,方便做出进一步的判断
  • 进入调试视图
  • 三种方式:
  • 单击工具栏的按钮
  • 右键单击编辑区
  • 快捷键:shift F9
  • 以上内部根据不同的编译器可能会不同

编程思想

  • 编程届的两大阵营

类与对象

  • 数据类型

  • 对象

  • 100、99、520 都是 int 类之下包含的相似的不同个例,这个个例专业数据称为实例或对象

  • 一切皆对象

创建类

  • 类的组成

    1. 属性
    2. 实例方法 self
    3. 静态方法
    4. 类方法 cls
class Student: #类 native_pace='广州' #写在类里的变量,称为类属性 #初始化方法 def __init__(self,name,age): self.name=name #self.name 称为实体属性,进行了一个复制的操作,将局部变量的 name 的值赋给实体属性 self.age=age #实例方法 def eat(self): #实例方法的参数中,必须写上 self ,哪怕不写它也会默认 print('学生在吃饭。') #静态方法 @staticmethod def method(): #静态方法的参数不允许写 self ,这是规定 print('我使用了 staticmethod 进行了修饰,所以我是静态方法') #类方法 @classmethod def cm(cls): #类方法括号中必须带 cls ,这是规定 print('我是类方法,因为我使用了 classmethod 进行修饰')
  • 在类外面定义的称之为函数,在类定义的称为方法

类的实例化

  • 意义:有了实例,就可以调用类中的内容
#创建 Student 类的实例对象 stulstul=Student('张三',20)stul.eat() #使用类的方法print(stul.name,stul.age) #获取类的属性#第二种调用方法:类名.方法名(类的实例对象),实际上就是方法定义处的selfStudent.eat(stul) #该代码写法的功能,与 stul.eat() 方法的功能一致

类属性

  • 类中方法外的变量称为类属性,被该类的所有对象所共享
print(Student.native_pace)stul=Student('张三',20)stu2=Student('李四',30)#修改类的属性值Student.native_pace='天津'print(stul.native_pase) #返回 天津print(stu2.native_pase) #返回 天津#类属性共享,供多个实例化访问相同的内存地址

类方法

  • 使用 @classmethod 修饰的方法,使用雷鸣直接访问的方法
Student.cm()

静态方法

  • 使用 @staticmethod 修饰的方法,使用类名直接访问的方法
Student.method()

动态绑定属性和方法

  • Python 是动态语言,在创建对象后,可以动态绑定属性和方法
class Student:    def __init__(self,name,age):        self.name=name        self.age=age            def eat(self):        print(self.name '在吃饭。')stu1=Student('张三',20)stu2=Student('李四',30)
#为实例对象 动态创建属性stu2.gender='女' #该属性值隶属于实例对象 stu2 的print(stu1.name,stu1.age) #输出 张三 20print(stu2.name,stu2.age,stu2.gender) #输出 李四 30 女
  • 动态绑定方法
#类之外创建一个函数def show():    print('定义在类之外的,称函数')#绑定到实例对象 stu1 的 show 方法stu1.show=showstu1.show()

封装

提高程序的安全性

  • 将数据(属性)和行为(方法)包装到类对象中。在方法内部对属性进行操作,在类对象的外部调用方法。这样,无序关心方法内部的具体实现细节,从而隔离了复杂度。
  • 在 Python 中没有专门的修饰符用于属性的私有,如果该属性不希望在类对象外被访问,前面使用两个“_”
#创建类class Car: def __init__(self,brand): self.brand=brand def start(self): print('汽车已启动。。。')#实例化类car=Car('宝马X5')#使用类的方法car.start()#使用类的属性print(car.brand)class Student: def __init__(self,name,age): self.name=name self.__age=age #年龄不希望在类的外部被使用,使用加了两个'_' def show(self): print(self.name,self.__age)stu=Student('张三',20)stu.show() #输出 张三 20print(stu.name) #输出 张三print(stu.__age) #程序抛错,提示属性错误,该属性为类的私有属性,外部不允许使用print(stu._Student__age) #在类的外部可以通过 _Student__age 进行访问
  • 提示:作为程序员,强烈建议不采取这种方式访问 _Student__age

继承

  • 提高代码的复用性
  • 语法格式
  • class 子类类名( 父类1 , 父类2... )
  • pass
  • 如果一个类没有继承任何基类,则默认继承 object
  • Python支持多继承
  • 定义子类时,必须在其构造函数中调用父类的构造函数
#多继承class A(object):    passclass B(object):    pass#C类继承了A、B两个类class C(A,B):    pass

方法重写

  • 如果子类对继承自父类的某个属性或方法不满意,可以在子类中对其(方法体)进行重新编写
  • 子类重写后的方法中可以通过 super().xxx() 调用父类中被重写的方法

object类

  • object 类是所有类的父类,所有类都有 object 类的属性和方法
  • 内置函数 dir() 可以查看指定对象所有属性
  • Object 有一个 str() 方法,用于返回一个对于“对象的描述”,对应于内置函数 str() 经常用于 print() 方法,帮我们查看对象的信息,所有我们经常会对 str() 进行重写

多太

提高程序的可扩展性和可维护性

  • 即便不知道一个变量所引用的对象到底是什么类型,仍然可以通过这个变量调用方法,在运行过程中根据变量所引用对象的类型,动态决定调用哪个对象中的方法

特殊方法和特殊属性

变量赋值操作

  • 只是形成两个变量,实际上还是指向同一个对象
class CPU: passclass Disk: passclass Computer: def __init__(self,cpu,disk): self.cpu=cpu self.disk=disk#实例CPU的类实例cpu1=CPU()#将实例对象 cpu1 赋值给 cpu2cpu2=cpu1#输出两个对象的内存地址是一样的print(cpu1,cpu2)#总结,变量赋值,实际上还是指向同一个对象

浅拷贝

  • Python 拷贝一版都是浅拷贝,拷贝时,对象包含的子对象不拷贝,因此,源对象与拷贝对象会引用同一个子对象
class CPU:    passclass Disk:    passclass Computer:    def __init__(self,cpu,disk):        self.cpu=cpu        self.disk=disk  cpu1=CPU() disk1=Disk() computer1=Computer(cup1,disk1) #创建计算机的实例对象  #浅拷贝 import copy computer2=copy.copy(computer1)  #输出类对象的内存地址,及子类对象的地址 print(computer1,computer1.cpu,computer1.disk) print(computer2,computer2.cpu,computer2.disk)# 结论:computer类的两个实例化对象的内存地址不同,但两个 cpu 和 disk 子类实例对象的内存地址一样

深拷贝

  • 使用 copy 模块的 deepcopy 函数,递归拷贝对象中的子对象,源对象和拷贝对象所有的子对象也不相同
#深拷贝computer3=copy.deepcopy(computre1)print(computer1,computer1.cpu,computer1.disk)print(computer2,computer2.cpu,computer2.disk)# 结论:computer类与两个 cpu 和 disk 子类实例对象的内存地址都不一样

模块

什么是模块

  • 模块的英文名称:Modules
  • 函数与模块的关系:一个模块中包含多个函数
  • 在 Python 中一个模块的文件扩展名为 .py
  • 使用模块的好处:
    1. 方便其他程序和脚本的导入并使用
    2. 避免函数名和变量名冲突
    3. 提高代码的可维护性
    4. 提高代码的可重用性

自定义模块

  • 新建一个 .py 文件,名称不要与 Python 自带的标准模块名称相同

导入模块

  • import 模块名称 [as 别名]
  • from 模块名称 import 函数/变量/类
#1.引入模块名称import math #引入一个数学运算的模块print(math.pi)  #调用 math 模块中的 pi 函数,输出一个π的数值,显示:3.1415926print(dir(math)) #查询 math 模块中的所有可操作的函数或方法#2.引入某个模块中的函数、变量或类from math import pifrom math import powprint(pi)print(pow(2,3))

以主程序形式运行

  • 在每个模块的定义中都包括一个记录模块名称的变量 __name__,程序可以检查该变量,以确定他们在哪个模块中执行。如果一个模块不是被导入到其他模块中执行,那么它可能在解释器的顶级模块中执行。顶级模块的 __name__ 变量的值为 __main__
# 创建文件 calc.py 文件def add(a,b): return a bif __name__ = '__main__': print(add(10,20))#1.当其他文件调用了 calc.py 文件,print 不会被执行#2.当 calc.py 文件本身被执行,print 会执行输出,因为 calc.py 文件被主动执行时,__name__ 会被标记为当前程序 __main__

  • 包是一个分层次的目录结构,它将一组功能相近的模块组织在一个目录下

  • 作用:

    1. 代码规范
    2. 避免模块名称冲突
  • 包与目录的区别

    1. 包:含 __init__.py 文件的目录称为包,一个包可以包含多个模块
    2. 目录:里不包含 __init__.py 文件
  • 包的导入
    import 包名.模块名

#导入包中的模块 import 包名.模块名 as 别名import pageage1.mouduleA as ma#调用该模块里的函数print(ma.a)

Python 中常用的内置模块

第三方模块的安装及使用

  • 安装第三方模块
pip install 模块名
  • 在线安装

  • 使用第三方模块

import 模块名

知识总结

文件目录

编码格式

  • Python 解释器使用的是 Unicode(内存)
  • .py 文件在磁盘上使用 UTF-8 存储(外存)

文件读写原理

  • 文件读写俗称“IO操作”
    -内置函数 open() 创建文件对象

  • 语法规则
#创建文件对象file1=open('a.txt','r') #读取一个文件,模式为:只读#输出文件内容print(file1.readlines()) # readlines() 读取的是一个“列表”#关闭系统资源file1.close()

文件读写操作

  • 文件的类型
  • 按文件中的数据组织形式,文件分为两大类型:
    1. 文本文件:存储普通“字符”文本,默认为 Unicode 字符集,可以使用记事本程序打开
    2. 二进制文件:把数据内容用“字节”存储,无法用记事本打开,必须使用专用软件打开,例:mp3音频文件、png图片文件、doc文档 等
#创建写入的文件对象# w 写入,覆盖原文件# a 写入,在原文件内容后追加内容file2=open('b.txt','w') #模式为:写#写入信息file2.write('hello world')  #如果文件存在,则写入操作会覆盖原文件#关闭系统资源file2.close()#对二进制文件的读写操作src_file=open('logo.png','rb')  #创建只读的图像文件对象target_file=open('copylogo.png','rb')   #创建只写的图像文件对象#读取 src_file 文件对象,并写入到 target_file 文件对象中target_file.write(src_file.read())#关闭系统资源target_file.close()src_file.close()#最后,  号表示以读写的方式打开,需要与其他模式一起使用,例:a 

文件对象常用方法

with语句(上下文管理器)

  • with 语句可以自动管理上下文资源,不论什么原因跳出 with 块,都能确保文件正确关闭,以此来达到释放资源的目的

with open('a.txt','r') as file1: print(file1.read())#语句最后 with 会自动关闭释放,而不需要人为写关闭语句#完整的赋值粘贴一张图片的代码就是三行with open('logo.png','rb') as src_file: with open('copy2logo.png','wb') as target_file: target_file.write(src_file.read())

目录操作

  • OS 模块是 Python 内置的与操作系统功能和文件系统相关的模块,该模块中的语句执行结果通常与操作系统有关,在不同的操作系统上运行,得到的结果可能不一样
  • OS 模块与 OS.path 模块用于对目录或文件进行操作
#打开操作系统的记事本import osos.system('notepad.exe')#调用系统中的可执行文件,例如打开QQos.startfile('C:\\Program Files (x86)\\Tencent\\QQ\\Bin\\QQ.exe')
  • OS 模块操作目录相关函数

  • OS.path 模块操作目录相关函数

# walk 方法可以获取当前目录下所有文件及子目录里的所有文件import ospath=os.getcwd()lst_files=os.walk(path)for dirpath,dirname,filename in lst_files: print(dirpath) print(dirname) print(filename) print('----------- 分割线 -----------')

知识总结

其他知识

项目打包

  • 安装第三方模块
  • 在线安装方式
  • 语法:pip install PyInstaller
  • 执行打包操作
C:\Users\Administrator>pyinstaller -F E:\Python\Studentsys\student.py
  • -F 表示只生成一个 .exe 文件

%23%20%5BPython%20%E5%85%A8%E5%A5%97%E6%95%99%E7%A8%8B%5D(https%3A%2F%2Fwww.bilibili.com%2Fmedialist%2Fplay%2Fml485352109%2Fp1)%20%E5%AD%A6%E4%B9%A0%E7%AC%94%E8%AE%B0%0A%0A%5Btoc%5D%0A%0A%23%23%20print()%E5%87%BD%E6%95%B0%0A-%20%E8%BE%93%E5%87%BA%E6%95%B0%E5%AD%97%E3%80%81%E5%AD%97%E7%AC%A6%E4%B8%B2%E3%80%81%E5%90%AB%E8%BF%90%E7%AE%97%E7%AC%A6%E7%9A%84%E8%A1%A8%E8%BE%BE%E5%BC%8F%0A%60%60%60python%0Aprint(520)%0Aprint('Hello%20world')%0Aprint(%22Hello%20world%22)%0Aprint(3%2B1)%0A%23%E5%B0%86%E6%95%B0%E6%8D%AE%E8%BE%93%E5%87%BA%E6%96%87%E4%BB%B6%E4%B8%AD%0Afp%3Dopen('d%3A%2Ftext.txt'%2C'a%2B')%20%23a%2B%E5%A6%82%E6%9E%9C%E6%96%87%E4%BB%B6%E4%B8%8D%E5%AD%98%E5%9C%A8%E5%B0%B1%E5%88%9B%E5%BB%BA%EF%BC%8C%E5%AD%98%E5%9C%A8%E5%B0%B1%E5%9C%A8%E6%96%87%E4%BB%B6%E5%86%85%E5%AE%B9%E7%9A%84%E5%90%8E%E9%9D%A2%E7%BB%A7%E7%BB%AD%E8%BF%BD%E5%8A%A0%0Aprint('Hello%20world'%2Cfile%3Dfp)%0Afp.close()%0A%0A%23%E9%80%97%E5%8F%B7%EF%BC%8C%E4%B8%8D%E8%BF%9B%E8%A1%8C%E6%8D%A2%E8%A1%8C%E8%BE%93%E5%87%BA%EF%BC%88%E8%BE%93%E5%87%BA%E5%86%85%E5%AE%B9%E5%9C%A8%E4%B8%80%E8%A1%8C%E5%BD%93%E4%B8%AD%EF%BC%89%0Aprint('Hello'%2C'World'%2C'Python')%0A%60%60%60%0A%0A%23%23%20%E8%BD%AC%E4%B9%89%E5%AD%97%E7%AC%A6%0A-%20%E4%BB%80%E4%B9%88%E6%98%AF%E8%BD%AC%E7%A7%BB%E5%AD%97%E7%AC%A6%EF%BC%9F%0A%20%20%20%20-%20%E5%8F%8D%E6%96%9C%E6%9D%A0%2B%E6%83%B3%E8%A6%81%E5%AE%9E%E7%8E%B0%E7%9A%84%E8%BD%AC%E7%A7%BB%E5%8A%9F%E8%83%BD%E9%A6%96%E5%AD%97%E6%AF%8D%E3%80%82%0A-%20%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81%E8%BD%AC%E7%A7%BB%E5%AD%97%E7%AC%A6%EF%BC%9F%0A%20%20%20%20-%20%E5%BD%93%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%B8%AD%E5%8C%85%E5%90%AB%E5%8F%8D%E6%96%9C%E6%9D%A0%E3%80%81%E5%8D%95%E5%BC%95%E5%8F%B7%E5%92%8C%E5%8F%8C%E5%BC%95%E5%8F%B7%E7%AD%89%E6%9C%89%E7%89%B9%E6%AE%8A%E7%94%A8%E9%80%94%E7%9A%84%E5%AD%97%E7%AC%A6%E6%97%B6%EF%BC%8C%E5%BF%85%E9%A1%BB%E4%BD%BF%E7%94%A8%E5%8F%8D%E6%96%9C%E6%9D%A0%E5%AF%B9%E8%BF%99%E4%BA%9B%E5%AD%97%E7%AC%A6%E8%BF%9B%E8%A1%8C%E8%BD%AC%E4%B9%89%EF%BC%88%E8%BD%AC%E6%8D%A2%E4%B8%80%E4%B8%AA%E5%90%AB%E4%B9%89%EF%BC%89%0A%20%20%20%20%20%20%20%20-%20%E5%8F%8D%E6%96%9C%E6%9D%A0%EF%BC%9A%5C%5C%0A%20%20%20%20%20%20%20%20-%20%E5%8D%95%E5%BC%95%E5%8F%B7%EF%BC%9A%5C'%0A%20%20%20%20%20%20%20%20-%20%E5%8F%8C%E5%BC%95%E5%8F%B7%EF%BC%9A%5C%22%0A%20%20%20%20-%20%E5%BD%93%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%B8%AD%E5%8C%85%E5%90%AB%E6%8D%A2%E8%A1%8C%E3%80%81%E5%9B%9E%E8%BD%A6%EF%BC%8C%E6%B0%B4%E5%B9%B3%E5%88%B6%E8%A1%A8%E7%AC%A6%E6%88%96%E9%80%80%E6%A0%BC%E7%AD%89%E6%97%A0%E6%B3%95%E7%9B%B4%E6%8E%A5%E8%A1%A8%E7%A4%BA%E7%9A%84%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6%E6%97%B6%EF%BC%8C%E4%B9%9F%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E8%BD%AC%E4%B9%89%E5%AD%97%E7%AC%A6%E5%BD%93%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%B8%AD%E5%8C%85%E5%90%AB%E6%8D%A2%E8%A1%8C%E3%80%81%E5%9B%9E%E8%BD%A6%EF%BC%8C%E6%B0%B4%E5%B9%B3%E5%88%B6%E8%A1%A8%E7%AC%A6%E6%88%96%E9%80%80%E6%A0%BC%E7%AD%89%E6%97%A0%E6%B3%95%E7%9B%B4%E6%8E%A5%E8%A1%A8%E7%A4%BA%E7%9A%84%E7%89%B9%E6%AE%8A%E5%AD%97%E7%AC%A6%E6%97%B6%EF%BC%8C%E4%B9%9F%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E8%BD%AC%E4%B9%89%E5%AD%97%E7%AC%A6%0A%20%20%20%20%20%20%20%20-%20%E6%8D%A2%E8%A1%8C%EF%BC%9A%5Cn%0A%20%20%20%20%20%20%20%20-%20%E5%9B%9E%E8%BD%A6%EF%BC%9A%5Cr%0A%20%20%20%20%20%20%20%20-%20%E6%B0%B4%E5%B9%B3%E5%88%B6%E8%A1%A8%E7%AC%A6%EF%BC%9A%5Ct%0A%20%20%20%20%20%20%20%20-%20%E9%80%80%E6%A0%BC%EF%BC%9A%5Cb%0A%60%60%60python%0Aprint('Hello%5Cnworld')%0Aprint('Hello%5Ctworld')%0Aprint('Hello%5Cbworld')%0Aprint('http%3A%5C%5C%5C%5Cwww.baidu.com')%0Aprint('%E8%80%81%E5%AE%9E%E8%AF%B4%EF%BC%9A%5C'%E5%A4%A7%E5%AE%B6%E5%A5%BD%5C'')%0A%23%E5%8E%9F%E5%AD%97%E7%AC%A6%EF%BC%8C%E8%AE%A9%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%B8%AD%E7%9A%84%E8%BD%AC%E7%A7%BB%E5%AD%97%E7%AC%A6%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8%0Aprint(r'Hello%5Cnworld')%0A%60%60%60%0A%0A%23%23%20%E4%BA%8C%E8%BF%9B%E5%88%B6%E4%B8%8E%E5%AD%97%E7%AC%A6%E7%BC%96%E7%A0%81%0A%60%60%60python%0Aprint(chr(0b100111001011000))%20%230b%E8%A1%A8%E7%A4%BA%E4%BA%8C%E8%BF%9B%E5%88%B6%0Aprint(ord('%E4%B9%98'))%0A%60%60%60%0A%0A%23%23%20Python%E4%B8%AD%E7%9A%84%E6%A0%87%E8%AF%86%E7%AC%A6%E5%92%8C%E4%BF%9D%E7%95%99%E5%AD%97%0A!%5Bfd2ff3633edb006d3aaad3f708ec38bf.png%5D(en-resource%3A%2F%2Fdatabase%2F813%3A1)%0A%0A%23%23%20%E5%8F%98%E9%87%8F%E7%9A%84%E5%AE%9A%E4%B9%89%E5%92%8C%E4%BD%BF%E7%94%A8%0A!%5B87ab1b805028b05d69d625cdb2c02697.png%5D(en-resource%3A%2F%2Fdatabase%2F812%3A1)%0A%0A%60%60%60python%0Aname%3D'%E9%A9%AC%E4%B8%BD%E4%BA%9A'%0Aprint(name)%0Aprint('%E6%A0%87%E8%AF%86'%2Cid(name))%0Aprint('%E7%B1%BB%E5%9E%8B'%2Ctype(name))%0Aprint('%E5%80%BC'%2Cname)%0A%60%60%60%0A%0A!%5Bfc79299f2d3863f70396705daddfc34b.png%5D(en-resource%3A%2F%2Fdatabase%2F815%3A1)%0A!%5Bdd32ac0befdc32d36aa771242312eb9b.png%5D(en-resource%3A%2F%2Fdatabase%2F814%3A1)%0A%0A%23%23%20%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%0A%3E%20%E9%92%88%E5%AF%B9%E6%B5%AE%E7%82%B9%E7%B1%BB%E5%9E%8B%EF%BC%88float%EF%BC%89%E5%AD%98%E5%82%A8%E4%B8%8D%E7%B2%BE%E7%A1%AE%E7%9A%84%E9%97%AE%E9%A2%98%EF%BC%8C%E8%A7%A3%E5%86%B3%E6%96%B9%E6%A1%88%E6%98%AF%EF%BC%9A%E5%AF%BC%E5%85%A5%E6%A8%A1%E5%9D%97%20decimal%0A%60%60%60python%0Afrom%20decimal%20import%20Decimal%0Aprint(Decimal('1.1')%2BDecimal('2.2'))%20%23%E4%B8%8D%E4%BC%9A%E5%87%BA%E7%8E%B0%E5%B0%8F%E6%95%B0%E4%BD%8D%E4%B8%8D%E7%B2%BE%E7%A1%AE%E7%9A%84%E6%83%85%E5%86%B5%E4%BA%86%0A%60%60%60%0A%0A%3E%E5%B8%83%E5%B0%94%E5%9E%8B%EF%BC%88bool%EF%BC%89%E5%8F%AF%E4%BB%A5%E8%BD%AC%E6%8D%A2%E6%88%90%E6%95%B4%E6%95%B0%E5%9E%8B%0A%60%60%60python%0Aprint(True%2B1)%0A%60%60%60%0A%3E%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%B1%BB%E5%9E%8B%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E5%8D%95%E5%BC%95%E5%8F%B7%E3%80%81%E5%8F%8C%E5%BC%95%E5%8F%B7%E3%80%81%E4%B8%89%E5%BC%95%E5%8F%B7%E5%AE%9A%E4%B9%89%EF%BC%8C%E5%85%B6%E4%B8%AD%EF%BC%9A%E5%8D%95%E5%BC%95%E5%8F%B7%E3%80%81%E5%92%8C%E5%8F%8C%E5%BC%95%E5%8F%B7%E5%AE%9A%E4%B9%89%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%BF%85%E9%A1%BB%E5%9C%A8%E4%B8%80%E8%A1%8C%EF%BC%8C%E4%B8%89%E5%BC%95%E5%8F%B7%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%8F%AF%E4%BB%A5%E5%88%86%E5%B8%83%E5%9C%A8%E8%BF%9E%E7%BB%AD%E7%9A%84%E5%A4%9A%E8%A1%8C%0A%60%60%60python%0Astr4%3D%22%22%22%E4%BA%BA%E7%94%9F%E8%8B%A6%E7%9F%AD%0A%E6%88%91%E7%94%A8Python%22%22%22%0A%60%60%60%0A%0A%23%23%20%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2%0A!%5B536737f90a4c39e1c0b93d8bf70c1896.png%5D(en-resource%3A%2F%2Fdatabase%2F816%3A1)%0A%0A%60%60%60python%0Aname%3D'%E5%BC%A0%E4%B8%89'%0Aage%3D20%0Aprint(type(name)%2Ctype(age))%0Aprint('%E6%88%91%E5%8F%AB'%2Bname%2B'%EF%BC%8C%E4%BB%8A%E5%B9%B4'%2Bstr(age)%2B'%E5%B2%81%E3%80%82')%20%23%E5%B0%86%20int%20%E7%B1%BB%E5%9E%8B%E9%80%9A%E8%BF%87%20str()%20%E8%BD%AC%E6%8D%A2%E6%88%90%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%B1%BB%E5%9E%8B%E3%80%82%0A%60%60%60%0A%0A%23%23%20Python%E4%B8%AD%E7%9A%84%E6%B3%A8%E9%87%8A%0A!%5Bbb1eabd586804f26fcfa2614a653e179.png%5D(en-resource%3A%2F%2Fdatabase%2F817%3A1)%0A%0A%23%23%20input()%E8%BE%93%E5%85%A5%E5%87%BD%E6%95%B0%0A%3E%E4%BD%9C%E7%94%A8%EF%BC%9A%E6%8E%A5%E6%94%B6%E6%9D%A5%E8%87%AA%E7%94%A8%E6%88%B7%E7%9A%84%E8%BE%93%E5%85%A5%0A%3E%E8%BF%94%E5%9B%9E%E5%80%BC%E7%B1%BB%E5%9E%8B%EF%BC%9A%E8%BE%93%E5%85%A5%E5%80%BC%E7%9A%84%E7%B1%BB%E5%9E%8B%E4%B8%BAstr%0A%3E%E5%80%BC%E7%9A%84%E5%AD%98%E5%82%A8%EF%BC%9A%E4%BD%BF%E7%94%A8%3D%E5%AF%B9%E8%BE%93%E5%85%A5%E7%9A%84%E5%80%BC%E8%BF%9B%E8%A1%8C%E5%AD%98%E5%82%A8%0A%60%60%60python%0Apresent%3Dinput('%E5%A4%A7%E5%9C%A3%E6%83%B3%E8%A6%81%E4%BB%80%E4%B9%88%E7%A4%BC%E7%89%A9%E5%91%A2%EF%BC%9F')%0A%0Aa%3Dinput('%E8%AF%B7%E8%BE%93%E5%85%A5%E4%B8%80%E4%B8%AA%E5%8A%A0%E6%95%B0%EF%BC%9A')%20%23%E8%BE%93%E5%85%A5%E7%9A%84%E6%95%B0%E5%AD%97%E4%B8%BAstr%E7%B1%BB%E5%9E%8B%E7%9A%84%0Aa%3Dint(a)%20%23%E5%AF%B9%E8%BE%93%E5%85%A5%E7%9A%84%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2%0Ab%3Dinput('%E8%AF%B7%E8%BE%93%E5%85%A5%E5%8F%A6%E4%B8%80%E4%B8%AA%E5%8A%A0%E6%95%B0%EF%BC%9A')%20%20%23%E8%BE%93%E5%85%A5%E7%9A%84%E6%95%B0%E5%AD%97%E4%B8%BAstr%E7%B1%BB%E5%9E%8B%E7%9A%84%0Ab%3Dint(b)%20%23%E5%AF%B9%E8%BE%93%E5%85%A5%E7%9A%84%E6%95%B0%E6%8D%AE%E8%BD%AC%E6%8D%A2%0Aprint(a%2Bb)%0A%0A%23%E7%AC%AC%E4%BA%8C%E7%A7%8D%E6%96%B9%E5%BC%8F%E5%AE%9E%E7%8E%B0%0Aa%3Dint(input('%E8%AF%B7%E8%BE%93%E5%85%A5%E4%B8%80%E4%B8%AA%E5%8A%A0%E6%95%B0%EF%BC%9A'))%0Ab%3Dint(input('%E8%AF%B7%E8%BE%93%E5%85%A5%E5%8F%A6%E4%B8%80%E4%B8%AA%E5%8A%A0%E6%95%B0%EF%BC%9A'))%0A%60%60%60%0A%0A%23%23%20Python%E4%B8%AD%E7%9A%84%E8%BF%90%E7%AE%97%E7%AC%A6%0A!%5B0cd50537ebc85c8df7c825edec8627be.png%5D(en-resource%3A%2F%2Fdatabase%2F818%3A1)%0A!%5Bee5d05ccbf5c3dc0b7d075be3bb57baf.png%5D(en-resource%3A%2F%2Fdatabase%2F819%3A1)%0A%0A%60%60%60python%0A%0A%23%E5%8F%96%E4%BD%99%E8%BF%90%E7%AE%97%E7%AC%A6%0Aprint(11%252)%20%23%E7%AD%89%E4%BA%8E1%EF%BC%8C%E4%BD%99%E6%95%B0%E6%98%AF1%0A%0A%23%E5%B9%82%E8%BF%90%E7%AE%97%E7%AC%A6%0Aprint(2**2)%20%23%E8%A1%A8%E7%A4%BA%202%20%E7%9A%84%202%20%E6%AC%A1%E6%96%B9%0Aprint(2**3)%20%23%E8%A1%A8%E7%A4%BA%202%20%E7%9A%84%203%E6%AC%A1%E6%96%B9%EF%BC%8C%E4%B9%9F%E5%B0%B1%E6%98%AF%202*2*2%20%3D%208%0A%60%60%60%0A%0A!%5Bd29edb91edc4925e5b7bd33e70f86703.png%5D(en-resource%3A%2F%2Fdatabase%2F820%3A1)%0A%0A%60%60%60python%0A%23%E8%B5%8B%E5%80%BC%E8%BF%90%E7%AE%97%E7%AC%A6%E4%B8%BE%E4%BE%8B%0Aa%3D20%0Aa%2B%3D30%0Aprint(a)%20%23%E7%BB%93%E6%9E%9C%E6%98%AF50%EF%BC%8C%E7%9B%B8%E5%BD%93%E4%BA%8E%20a%2B30%0A%0A%23%E8%A7%A3%E5%8C%85%E8%B5%8B%E5%80%BC%E4%B8%BE%E4%BE%8B%0Aa%2Cb%2Cc%3D20%2C30%2C40%20%23%E5%B7%A6%E5%8F%B3%E4%B8%AA%E6%95%B0%E9%9C%80%E4%B8%80%E8%87%B4%0A%0A%23%E6%AF%94%E8%BE%83%E8%BF%90%E7%AE%97%E7%AC%A6%E7%9A%84%E7%BB%93%E6%9E%9C%E4%B8%BAbool%E7%B1%BB%E5%9E%8B%EF%BC%8C%E6%AF%94%E8%BE%83%E7%9A%84%E6%98%AF%E5%80%BC%0A%23%20is%20%E6%A0%87%E8%AF%86%E6%AF%94%E8%BE%83%E7%AC%A6%0Aprint('a%3Eb%E5%90%97%EF%BC%9F'%2Ca%3Eb)%20%23%20False%0Aprint(a%3D%3Db)%20%23%20True%20%E8%A1%A8%E7%A4%BA%20a%20%E4%B8%8E%20b%20%E7%9A%84%20value%20%E7%9B%B8%E7%AD%89%0Aprint(a%20is%20b)%20%23%20True%20%E8%A1%A8%E7%A4%BA%20a%20%E4%B8%8E%20b%20%E7%9A%84%20id%E6%A0%87%E8%AF%86%E7%9B%B8%E7%AD%89%0Aprint(a%20is%20not%20b)%20%23%20False%20id%E6%A0%87%E8%AF%86%E7%AC%A6%E4%B8%8D%E7%9B%B8%E7%AD%89%0A%0A%23%20in%20%E4%B8%8E%20not%20in%20%E6%AF%94%E8%BE%83%E7%AC%A6%0As%3D'helloworld'%0Aprint('w'%20in%20s)%20%23True%0Aprint('k'%20in%20s)%20%23False%0Aprint('w'%20not%20in%20s)%20%23False%0Aprint('k'%20not%20in%20s)%20%23True%0A%60%60%60%0A!%5Be132b6c5dd884bb746c61f16ac37fb0d.png%5D(en-resource%3A%2F%2Fdatabase%2F821%3A1)%0A%60%60%60python%0Aprint(4%268)%20%23%E6%8C%89%E4%BD%8D%E4%B8%8E%26%EF%BC%8C%E5%90%8C%E4%B8%BA1%E6%97%B6%E7%BB%93%E6%9E%9C%E4%B8%BA1%0Aprint(4%7C8)%20%23%E6%8C%89%E4%BD%8D%E6%88%96%7C%EF%BC%8C%E5%90%8C%E4%B8%BA0%E6%97%B6%E7%BB%93%E6%9E%9C%E4%B8%BA0%0Aprint(4%3C%3C1)%20%23%E5%90%91%E5%B7%A6%E7%A7%BB%E5%8A%A81%E4%BD%8D%EF%BC%8C%E7%9B%B8%E5%BD%93%E4%BA%8E%20%E4%B9%98%E4%BB%A5%202%0Aprint(4%3E%3E2)%20%23%E5%90%91%E5%8F%B3%E7%A7%BB%E5%8A%A82%E4%BD%8D%EF%BC%8C%E7%9B%B8%E5%BD%93%E4%BA%8E%20%E9%99%A4%E4%BB%A5%204%0A%60%60%60%0A!%5B5aca35eb2329f84f7ed06c04c4ca2ed6.png%5D(en-resource%3A%2F%2Fdatabase%2F822%3A1)%0A%0A%23%23%20%E7%A8%8B%E5%BA%8F%E7%9A%84%E7%BB%84%E7%BB%87%E7%BB%93%E6%9E%84%0A%3E%E4%B8%89%E7%A7%8D%E5%9F%BA%E6%9C%AC%E7%BB%93%E6%9E%84%E7%BB%84%E6%88%90%EF%BC%9A***%E9%A1%BA%E5%BA%8F%E7%BB%93%E6%9E%84***%E3%80%81***%E9%80%89%E6%8B%A9%E7%BB%93%E6%9E%84***%E3%80%81***%E5%BE%AA%E7%8E%AF%E7%BB%93%E6%9E%84***%0A%3E***Python%E4%B8%80%E5%88%87%E7%9A%86%E5%AF%B9%E8%B1%A1%EF%BC%8C%E6%89%80%E6%9C%89%E5%AF%B9%E8%B1%A1%E9%83%BD%E6%9C%89%E4%B8%80%E4%B8%AA%E5%B8%83%E5%B0%94%E5%80%BC***%0A%0A%60%60%60python%0A%23%20%E5%8D%95%E5%88%86%E6%94%AF%E7%BB%93%E6%9E%84%0Amoney%3D1000%0As%3Dint(input('%E8%AF%B7%E8%BE%93%E5%85%A5%E5%8F%96%E6%AC%BE%E9%87%91%E9%A2%9D%EF%BC%9A'))%0Aif%20money%3E%3Ds%3A%0A%20%20%20%20money%3Dmoney-s%0A%20%20%20%20print('%E5%8F%96%E6%AC%BE%E6%88%90%E5%8A%9F%EF%BC%8C%E4%BD%99%E9%A2%9D%E4%B8%BA%EF%BC%9A'%2Cmoney)%0A%0A%23%20%E5%8F%8C%E5%88%86%E6%94%AF%E7%BB%93%E6%9E%84%0Aif%20money%3E%3Ds%3A%0A%20%20%20%20money%3Dmoney-s%0A%20%20%20%20print('%E5%8F%96%E6%AC%BE%E6%88%90%E5%8A%9F%EF%BC%8C%E4%BD%99%E9%A2%9D%E4%B8%BA%EF%BC%9A'%2Cmoney)%0Aelse%3A%0A%20%20%20%20print('%E4%BD%99%E9%A2%9D%E4%B8%8D%E8%B6%B3')%0A%0A%23%20%E5%A4%9A%E5%88%86%E6%94%AF%E7%BB%93%E6%9E%84%0Ascore%3Dint(input('%E8%AF%B7%E8%BE%93%E5%85%A5%E4%B8%80%E4%B8%AA%E6%88%90%E7%BB%A9%EF%BC%9A'))%0Aif%20score%3E%3D90%20and%20score%3C%3D100%3A%0A%20%20%20%20print('A%E7%BA%A7')%0Aelif%20score%3E%3D70%20and%20score%3C%3D89%3A%0A%20%20%20%20print('B%E7%BA%A7')%0Aelif%20score%3E%3D60%20and%20score%3C%3D69%3A%0A%20%20%20%20print('C%E7%BA%A7')%0Aelif%20score%3E%3D0%20and%20score%3C%3D59%3A%0A%20%20%20%20print('D%E7%BA%A7')%0Aelse%3A%0A%20%20%20%20print('%E5%AF%B9%E4%B8%8D%E8%B5%B7%EF%BC%8C%E6%88%90%E7%BB%A9%E8%BE%93%E5%85%A5%E6%9C%89%E8%AF%AF%E3%80%82')%0A%0A%23%20%E8%BF%98%E5%8F%AF%E4%BB%A5%E7%94%A8%E4%B8%8B%E9%9D%A2%E8%AF%AD%E6%B3%95%E8%A1%A8%E8%BE%BE%0Aif%2090%3C%3Dscore%3C%3D100%3A%0A%20%20%20%20print('A%E7%BA%A7')%0Aelif%2070%3C%3Dscore%3C%3D89%3A%0A%20%20%20%20print('B%E7%BA%A7')%0Aelif%2060%3C%3Dscore%3C%3D69%3A%0A%20%20%20%20print('C%E7%BA%A7')%0Aelif%200%3C%3Dscore%3C%3D59%3A%0A%20%20%20%20print('D%E7%BA%A7')%0Aelse%3A%0A%20%20%20%20print('%E5%AF%B9%E4%B8%8D%E8%B5%B7%EF%BC%8C%E6%88%90%E7%BB%A9%E8%BE%93%E5%85%A5%E6%9C%89%E8%AF%AF%E3%80%82')%0A%0A%23%20%E4%BD%BF%E7%94%A8%E6%9D%A1%E4%BB%B6%E8%A1%A8%E8%BE%BE%E5%BC%8F%E8%BF%9B%E8%A1%8C%E6%AF%94%E8%BE%83%0Aa%3D10%0Ab%3D20%0Aprint(str(a)%2B'%E5%A4%A7%E4%BA%8E%E7%AD%89%E4%BA%8E'%2Bstr(b)%20if%20a%3E%3Db%20else%20str(a)%2B'%E5%B0%8F%E4%BA%8E'%2Bstr(b))%0A%0A%23%20pass%E8%AF%AD%E5%8F%A5%EF%BC%8C%E4%BB%80%E4%B9%88%E9%83%BD%E4%B8%8D%E5%81%9A%EF%BC%8C%E5%8F%AA%E6%98%AF%E4%B8%80%E4%B8%AA%E5%8D%A0%E4%BD%8D%E7%AC%A6%EF%BC%8C%E7%94%A8%E5%88%B0%E9%9C%80%E8%A6%81%E5%86%99%E8%AF%AD%E5%8F%A5%E7%9A%84%E5%9C%B0%E6%96%B9%EF%BC%8C%E7%94%A8%E4%BA%8E%E5%89%8D%E6%9C%9F%E6%90%AD%E5%BB%BA%E4%BB%A3%E7%A0%81%E7%BB%93%E6%9E%84%E7%9A%84%E5%9C%B0%E6%96%B9%0Aif%20answer%3D%3D'y'%3A%0A%20%20%20%20pass%0Aelse%3A%0A%20%20%20%20pass%0A%0A%23%20while%20%E5%BE%AA%E7%8E%AF%0Aa%3D1%0Awhile%20a%3C10%3A%0A%20%20%20%20print(a)%0A%20%20%20%20a%2B%3D1%0A%0A%23%20for-in%20%E5%BE%AA%E7%8E%AF%0Afor%20item%20in%20'python'%3A%0A%20%20%20%20print(item)%0A%0A%23%20break%20%E8%AF%AD%E5%8F%A5%EF%BC%8C%E7%94%A8%E4%BA%8E%E7%BB%93%E6%9D%9F%E5%BE%AA%E7%8E%AF%E7%BB%93%E6%9E%84%EF%BC%8C%E9%80%9A%E5%B8%B8%E4%B8%8E%E5%88%86%E6%94%AF%E7%BB%93%E6%9E%84%20if%20%E4%B8%80%E8%B5%B7%E4%BD%BF%E7%94%A8%0A%0A%23%20continue%20%E8%AF%AD%E5%8F%A5%EF%BC%8C%E7%94%A8%E4%BA%8E%E7%BB%93%E6%9D%9F%E5%BD%93%E5%89%8D%E5%BE%AA%E7%8E%AF%EF%BC%8C%E8%BF%9B%E5%85%A5%E4%B8%8B%E4%B8%80%E4%B8%AA%E5%BE%AA%E7%8E%AF%EF%BC%8C%E9%80%9A%E5%B8%B8%E4%B8%8E%E5%88%86%E6%94%AF%E7%BB%93%E6%9E%84%20if%20%E4%B8%80%E8%B5%B7%E4%BD%BF%E7%94%A8%0A%60%60%60%0A-%20else%20%E4%B8%8E%E8%AF%AD%E5%8F%A5%0A-%20%E4%B8%8E%20else%20%E8%AF%AD%E5%8F%A5%E9%85%8D%E5%90%88%E4%BD%BF%E7%94%A8%E7%9A%84%E4%B8%89%E7%A7%8D%E6%83%85%E5%86%B5%E4%B8%BA%EF%BC%9Aif-else%20%5C%20while-else%20%5C%20for-else%0A%0A%23%23%20%E5%88%97%E8%A1%A8%0A-%20%E5%88%97%E8%A1%A8%E9%9C%80%E8%A6%81%E4%BD%BF%E7%94%A8%E4%B8%AD%E6%8B%AC%E5%8F%B7%5B%5D%EF%BC%8C%E5%85%83%E7%B4%A0%E9%97%B4%E7%94%A8%E8%8B%B1%E6%96%87%E9%80%97%E5%8F%B7%E5%88%86%E9%9A%94%0A%60%60%60%20python%0Alst%3D%5B'hello'%2C'world'%2C98%5D%0A%60%60%60%0A-%20%E5%88%9B%E5%BB%BA%E5%88%97%E8%A1%A8%E7%AC%AC%E4%BA%8C%E7%A7%8D%E6%96%B9%E5%BC%8F%EF%BC%8C%E4%BD%BF%E7%94%A8%E5%86%85%E7%BD%AE%E5%87%BD%E6%95%B0%20list()%0A%60%60%60python%0Alst2%3D(%5B'hello'%2C'world'%2C98%5D)%0A%60%60%60%0A%3E%20%E5%88%97%E8%A1%A8%E7%9A%84%E7%89%B9%E7%82%B9%0A%3E%20%E5%88%97%E8%A1%A8%E5%85%83%E7%B4%A0%E6%8C%89%E9%A1%BA%E5%BA%8F%E6%9C%89%E5%BA%8F%E6%8E%92%E5%BA%8F%0A%3E%20%E7%B4%A2%E5%BC%95%E6%98%A0%E5%B0%84%E5%94%AF%E4%B8%80%E4%B8%AA%E6%95%B0%E6%8D%AE%0A%3E%20%E5%88%97%E8%A1%A8%E5%8F%AF%E4%BB%A5%E5%AD%98%E5%82%A8%E9%87%8D%E5%A4%8D%E6%95%B0%E6%8D%AE%0A%3E%20%E4%BB%BB%E6%84%8F%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%E6%B7%B7%E5%AD%98%0A%3E%20%E6%A0%B9%E6%8D%AE%E9%9C%80%E8%A6%81%E5%8A%A8%E6%80%81%E5%88%86%E9%85%8D%E5%92%8C%E5%9B%9E%E6%94%B6%E5%86%85%E5%AD%98%0A%0A%23%23%23%20%E5%88%97%E8%A1%A8%E7%9A%84%E6%9F%A5%E8%AF%A2%E6%93%8D%E4%BD%9C%0A-%20%E8%8E%B7%E5%8F%96%E5%88%97%E8%A1%A8%E4%B8%AD%E6%8C%87%E5%AE%9A%E5%85%83%E7%B4%A0%E7%9A%84%E7%B4%A2%E5%BC%95%20index()%20%0A1.%20%E6%9F%A5%E8%AF%A2%E5%88%97%E8%A1%A8%E4%B8%AD%E5%AD%98%E5%9C%A8N%E4%B8%AA%E7%9B%B8%E5%90%8C%E5%85%83%E7%B4%A0%EF%BC%8C%E5%8F%AA%E8%BF%94%E5%9B%9E%E7%9B%B8%E5%90%8C%E5%85%83%E7%B4%A0%E4%B8%AD%E7%9A%84%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%E7%9A%84%E7%B4%A2%E5%BC%95%0A2.%20%E5%A6%82%E6%9E%9C%E6%9F%A5%E8%AF%A2%E7%9A%84%E5%85%83%E7%B4%A0%E5%9C%A8%E5%88%97%E8%A1%A8%E4%B8%AD%E4%B8%8D%E5%AD%98%E5%9C%A8%EF%BC%8C%E5%88%99%E4%BC%9A%E6%8A%9B%E5%87%BAValueError%0A3.%20%E8%BF%98%E5%8F%AF%E4%BB%A5%E5%9C%A8%E6%8C%87%E5%AE%9A%E7%9A%84%20start%20%E5%92%8C%20stop%20%E4%B9%8B%E9%97%B4%E8%BF%9B%E8%A1%8C%E6%9F%A5%E8%AF%A2%0A%60%60%60python%0Alst%3D%5B'hello'%2C'world'%2C89%2C'hello'%5D%0Aprint(lst.index('hello'))%20%23%E5%A6%82%E6%9E%9C%E5%AD%98%E5%9C%A8%E7%9B%B8%E5%90%8C%E5%85%83%E7%B4%A0%EF%BC%8C%E5%8F%AA%E8%BF%94%E5%9B%9E%E7%9B%B8%E5%90%8C%E5%85%83%E7%B4%A0%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%E7%9A%84%E7%B4%A2%E5%BC%95%0Aprint(lst.index('python'))%20%23%E6%8A%9B%E5%87%BA%20IndexError%20%E9%94%99%E8%AF%AF%0Aprint(lst.index('hello'%2C1%2C3))%20%23%E6%8C%87%E5%AE%9A%E8%8C%83%E5%9B%B4%E5%86%85%EF%BC%8C%E6%9F%A5%E6%89%BE%E7%B4%A2%E5%BC%95%201%20%E5%92%8C%202%0A%60%60%60%0A-%20%E8%8E%B7%E5%8F%96%E5%88%97%E8%A1%A8%E4%B8%AD%E7%9A%84%E5%8D%95%E4%B8%AA%E5%85%83%E7%B4%A0%0A1.%20%E6%AD%A3%E5%90%91%E7%B4%A2%E5%BC%95%E4%BB%8E1%E5%88%B0N-1%20%E4%B8%BE%E4%BE%8B%EF%BC%9Alst%5B0%5D%0A2.%20%E9%80%86%E5%90%91%E7%B4%A2%E5%BC%95%E4%BB%8E-N%E5%88%B0-1%20%E4%B8%BE%E4%BE%8B%EF%BC%9Alst%5B-N%5D%0A3.%20%E6%8C%87%E5%AE%9A%E7%B4%A2%E5%BC%95%E4%B8%8D%E5%AD%98%E5%9C%A8%EF%BC%8C%E6%8A%9B%E5%87%BA%20IndexError%0A%60%60%60python%0Alst%3D%5B'hello'%2C'world'%2C98%2C'hello'%2C'world'%2C234%5D%0Aprint(lst%5B2%5D)%20%23%E8%8E%B7%E5%8F%96%E7%B4%A2%E5%BC%95%E4%B8%BA2%E7%9A%84%E5%85%83%E7%B4%A0%0Aprint(lst%5B-3%5D)%20%23%E9%80%86%E5%90%91%E8%8E%B7%E5%8F%96%E7%B4%A2%E5%BC%95%E4%B8%BA-3%E7%9A%84%E5%85%83%E7%B4%A0%0A%60%60%60%0A-%20%E8%8E%B7%E5%8F%96%E5%88%97%E8%A1%A8%E4%B8%AD%E7%9A%84%E5%A4%9A%E4%B8%AA%E5%85%83%E7%B4%A0%0A%E8%AF%AD%E6%B3%95%E6%A0%BC%E5%BC%8F%0A**%E5%88%97%E8%A1%A8%E5%90%8D%20%5B%20start%20%3A%20stop%20%3A%20step%20%5D**%0A%60%60%60%20python%0A%23start%20stop%20step%20%E4%B8%BA%E7%A9%BA%E6%97%B6%E9%BB%98%E8%AE%A4%E4%B8%BA%200%E3%80%81%E6%9C%80%E5%A4%A7%E7%B4%A2%E5%BC%95%E3%80%811%0Aprint(lst%5B%3A%3A1%5D)%20%23%E6%AD%A3%E5%90%91step%0Aprint(lst%5B%3A%3A-1%5D)%20%23%E9%80%86%E5%90%91step%0A%60%60%60%0A%0A-%20%E5%88%A4%E6%96%AD%E6%8C%87%E5%AE%9A%E5%85%83%E7%B4%A0%E5%9C%A8%E5%88%97%E8%A1%A8%E4%B8%AD%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8%20in%20%E3%80%81not%20in%0A%E8%AF%AD%E6%B3%95%E6%A0%BC%E5%BC%8F%0A**%E5%85%83%E7%B4%A0%20in%20%E5%88%97%E8%A1%A8%E5%90%8D**%0A**%E5%85%83%E7%B4%A0%20not%20in%20%E5%88%97%E8%A1%A8%E5%90%8D**%0A%60%60%60python%0Aprint(10%20in%20lst)%0Aprint(10%20not%20in%20lst)%0A%60%60%60%0A%0A-%20%E9%81%8D%E5%8E%86%E5%88%97%E8%A1%A8%E5%85%83%E7%B4%A0%20for-in%0A%E8%AF%AD%E6%B3%95%E6%A0%BC%E5%BC%8F%0A**for%20%E8%BF%AD%E4%BB%A3%E5%8F%98%E9%87%8F%20in%20%E5%88%97%E8%A1%A8%E5%90%8D%3A**%0A%60%60%60python%0Afor%20item%20in%20lst%3A%0A%20%20%20%20print(item)%0A%60%60%60%0A%0A%23%23%23%20%E5%88%97%E8%A1%A8%E5%85%83%E7%B4%A0%E7%9A%84%E5%A2%9E%E5%8A%A0%E6%93%8D%E4%BD%9C%0A%60%60%60python%0Alst.append(100)%20%23%E5%9C%A8%E5%88%97%E8%A1%A8%E6%9C%AB%E5%B0%BE%E6%B7%BB%E5%8A%A0%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%0Alst.extend(lst2)%20%23%E5%9C%A8%E5%88%97%E8%A1%A8%E6%9C%AB%E5%B0%BE%E8%87%B3%E5%B0%91%E6%B7%BB%E5%8A%A0%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%0Alst.insert(1%2C90)%20%23%E5%9C%A8%E5%88%97%E8%A1%A8%E7%9A%84%E4%BB%BB%E6%84%8F%E4%BD%8D%E7%BD%AE%E6%B7%BB%E5%8A%A0%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%0Alst%5B1%3A%5D%3Dlst3%20%23%E5%9C%A8%E5%88%97%E8%A1%A8%E7%9A%84%E4%BB%BB%E5%8A%A1%E4%BD%8D%E7%BD%AE%E6%B7%BB%E5%8A%A0%E8%87%B3%E5%B0%91%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%EF%BC%8C%E4%BB%8E%E7%B4%A2%E5%BC%951%E5%BE%80%E5%90%8E%E7%9A%84%E5%85%83%E7%B4%A0%E5%88%87%E6%8E%89%EF%BC%8Clst3%E6%9B%BF%E6%8D%A2%E8%BF%9B%E6%9D%A5%0A%60%60%60%0A%0A%23%23%23%20%E5%88%97%E8%A1%A8%E5%85%83%E7%B4%A0%E7%9A%84%E5%88%A0%E9%99%A4%E6%93%8D%E4%BD%9C%0A%60%60%60python%0Alst.remove(30)%20%23%E5%88%A0%E9%99%A4%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%9C%89%E9%87%8D%E5%A4%8D%E5%85%83%E7%B4%A0%EF%BC%8C%E5%8F%AA%E5%88%A0%E9%99%A4%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%EF%BC%8C%E5%A6%82%E6%9E%9C%E5%85%83%E7%B4%A0%E4%B8%8D%E5%AD%98%E5%9C%A8%E5%88%99%E6%8A%9B%E9%94%99%20ValueError%0Alst.pop(1)%20%23%E5%88%A0%E9%99%A4%E7%B4%A2%E5%BC%95%E4%B8%BA1%E7%9A%84%E5%85%83%E7%B4%A0%0Alst.pop(5)%20%23%E5%88%A0%E9%99%A4%E7%B4%A2%E5%BC%95%E4%B8%BA5%E7%9A%84%E5%85%83%E7%B4%A0%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%8C%87%E5%AE%9A%E7%9A%84%E7%B4%A2%E5%BC%95%E4%BD%8D%E7%BD%AE%E4%B8%8D%E5%AD%98%E5%9C%A8%E5%B0%86%E6%8A%9B%E9%94%99%EF%BC%8C%E5%A6%82%E6%9E%9C%E4%B8%8D%E6%8C%87%E5%AE%9A%E5%8F%82%E6%95%B0%E5%88%99%E5%88%A0%E9%99%A4%E5%88%97%E8%A1%A8%E6%9C%80%E5%90%8E%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%0Alst%5B1%3A3%5D%3D%5B%5D%20%23%E5%88%87%E7%89%87%EF%BC%8C%E5%B0%86%E5%BD%93%E5%89%8D%E5%88%97%E8%A1%A8%E7%9A%841%E5%88%B03%E7%B4%A2%E5%BC%95%E7%9A%84%E5%85%83%E7%B4%A0%E9%80%9A%E8%BF%87%E4%BC%A0%E5%85%A5%E7%A9%BA%E7%9A%84%E6%96%B9%E5%BC%8F%E5%88%A0%E9%99%A4%0Alst2%3Dlst%5B1%3A3%5D%20%23%E5%88%87%E7%89%87%EF%BC%8C%E4%BA%A7%E7%94%9F%E6%96%B0%E7%9A%84%E5%88%97%E8%A1%A8%EF%BC%8C%E5%8E%9F%E5%88%97%E8%A1%A8%E4%B8%8D%E6%94%B9%E5%8F%98%0Alst.clear()%20%23%E5%88%A0%E9%99%A4%E5%88%97%E8%A1%A8%E4%B8%AD%E6%89%80%E6%9C%89%E5%85%83%E7%B4%A0%0Adel%20lst%20%23%E5%88%A0%E9%99%A4%E5%88%97%E8%A1%A8%E5%AF%B9%E8%B1%A1%0A%60%60%60%0A%23%23%23%20%E5%88%97%E8%A1%A8%E5%85%83%E7%B4%A0%E7%9A%84%E4%BF%AE%E6%94%B9%E6%93%8D%E4%BD%9C%0A-%20%E4%B8%BA%E6%8C%87%E5%AE%9A%E7%B4%A2%E5%BC%95%E7%9A%84%E5%85%83%E7%B4%A0%E8%B5%8B%E4%BA%88%E6%96%B0%E5%80%BC%0A%60%60%60python%0Alst%5B2%5D%3D100%20%23%E4%BF%AE%E6%94%B9%E7%B4%A2%E5%BC%952%E7%9A%84%E5%85%83%E7%B4%A0%E5%80%BC%E4%B8%BA100%0A%60%60%60%0A-%20%E4%B8%BA%E6%8C%87%E5%AE%9A%E7%9A%84%E5%88%87%E7%89%87%E8%B5%8B%E4%BA%88%E6%96%B0%E5%80%BC%0A%60%60%60python%0Alst%5B1%3A3%5D%3D%5B300%2C400%2C500%2C600%5D%0A%60%60%60%0A%0A%23%23%23%20%E5%88%97%E8%A1%A8%E5%85%83%E7%B4%A0%E7%9A%84%E6%8E%92%E5%BA%8F%E6%93%8D%E4%BD%9C%0A-%20%E8%B0%83%E7%94%A8%20sort()%20%E6%96%B9%E6%B3%95%EF%BC%8C%E5%88%97%E8%A1%A8%E4%B8%AD%E7%9A%84%E6%89%80%E6%9C%89%E5%85%83%E7%B4%A0%E9%BB%98%E8%AE%A4%E6%8C%89%E7%85%A7%E4%BB%8E%E5%B0%8F%E5%88%B0%E5%A4%A7%E7%9A%84%E9%A1%BA%E5%BA%8F%E6%8E%92%E5%BA%8F%EF%BC%8C%E5%8F%AF%E4%BB%A5%E6%8C%87%E5%AE%9A%20reverse%3DTrue%EF%BC%8C%E8%BF%9B%E8%A1%8C%E9%99%8D%E5%BA%8F%E6%8E%92%E5%BA%8F%0A%60%60%60python%0Alst.sort()%0Alst.sort(reverse%3DTrue)%0A%60%60%60%0A-%20%E8%B0%83%E7%94%A8%E5%86%85%E7%BD%AE%E5%87%BD%E6%95%B0%20sorted()%EF%BC%8C%E5%8F%AF%E4%BB%A5%E6%8C%87%E5%AE%9A%20reverse%3DTrue%EF%BC%8C%E8%BF%9B%E8%A1%8C%E9%99%8D%E5%BA%8F%E6%8E%92%E5%BA%8F%EF%BC%8C%E5%8E%9F%E5%88%97%E8%A1%A8%E4%B8%8D%E5%8F%91%E7%94%9F%E6%94%B9%E5%8F%98%0A%60%60%60python%0Alst2%3Dsorted(lst)%20%23%E5%87%BD%E6%95%B0%E4%BA%A7%E7%94%9F%E6%96%B0%E7%9A%84%E5%88%97%E8%A1%A8%E5%AF%B9%E8%B1%A1%0Alst3%3Dsorted(lst%2Creverse%3DTrue)%0A%60%60%60%0A%0A%23%23%23%20%E5%88%97%E8%A1%A8%E7%94%9F%E6%88%90%E7%9A%84%E5%85%AC%E5%BC%8F%0A%E8%AF%AD%E6%B3%95%E6%A0%BC%E5%BC%8F%0A%60%60%60python%0A%23%20%5B%20i*i%20for%20i%20in%20range(1%2C10)%20%5D%0A%23%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9%EF%BC%9A%E2%80%9C%E8%A1%A8%E7%A4%BA%E5%88%97%E8%A1%A8%E5%85%83%E7%B4%A0%E7%9A%84%E8%A1%A8%E8%BE%BE%E5%BC%8F%E2%80%9D%E4%B8%AD%E9%80%9A%E5%B8%B8%E5%8C%85%E5%90%AB%E8%87%AA%E5%AE%9A%E4%B9%89%E5%8F%98%E9%87%8F%0Alst%3D%5Bi%20for%20i%20in%20range(1%2C10)%5D%20%23%E4%BA%A7%E7%94%9F1%E5%88%B09%E7%9A%84%E5%88%97%E8%A1%A8%0Alst%3D%5Bi*2%20for%20i%20in%20range(1%2C10)%5D%20%23%E4%BA%A7%E7%94%9F2%2C4%E3%80%816%E3%80%818%E3%80%8110%E7%9A%84%E5%88%97%E8%A1%A8%0A%60%60%60%0A%0A%23%23%20%E5%AD%97%E5%85%B8%0A%23%23%23%20%E4%BB%80%E4%B9%88%E6%98%AF%E5%AD%97%E5%85%B8%0A%3E%20Python%20%E5%86%85%E7%BD%AE%E7%9A%84%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B9%8B%E4%B8%80%EF%BC%8C%E4%B8%8E%E5%88%97%E8%A1%A8%E4%B8%80%E6%A0%B7%E6%98%AF%E4%B8%80%E4%B8%AA%E5%8F%AF%E5%8F%98%E5%BA%8F%E5%88%97%0A%3E%20%E4%BB%A5%E9%94%AE%E5%80%BC%E5%AF%B9%E7%9A%84%E6%96%B9%E5%BC%8F%E5%AD%98%E5%82%A8%E6%95%B0%E6%8D%AE%EF%BC%8C%E5%AD%97%E5%85%B8%E6%98%AF%E4%B8%80%E4%B8%AA%E6%97%A0%E5%BA%8F%E7%9A%84%E5%BA%8F%E5%88%97%0A%0A%23%23%23%20%E5%AD%97%E5%85%B8%E7%9A%84%E5%8E%9F%E7%90%86%0A%3E%20%E5%AD%97%E5%85%B8%E4%BB%A5%E5%A4%A7%E6%8B%AC%E5%8F%B7%E8%A1%A8%E7%A4%BA%0A%60%60%60python%0Ascores%3D%7B%20'%E5%BC%A0%E4%B8%89'%3A100%2C'%E6%9D%8E%E5%9B%9B'%3A98%2C'%E7%8E%8B%E4%BA%94'%3A45%20%7D%0A%60%60%60%0A-%20%E5%AD%97%E5%85%B8%E7%9A%84%E5%AE%9E%E7%8E%B0%E5%8E%9F%E7%90%86%E4%B8%8E%E6%9F%A5%E5%AD%97%E5%85%B8%E7%B1%BB%E4%BC%BC%EF%BC%8C%E6%9F%A5%E5%AD%97%E5%85%B8%E6%98%AF%E5%85%88%E6%A0%B9%E6%8D%AE%E9%83%A8%E9%A6%96%E6%88%96%E6%8B%BC%E9%9F%B3%E6%9F%A5%E6%89%BE%E5%AF%B9%E5%BA%94%E7%9A%84%E9%A1%B5%E7%A0%81%EF%BC%8CPython%20%E4%B8%AD%E7%9A%84%E5%AD%97%E5%85%B8%E6%98%AF%E6%A0%B9%E6%8D%AE%20key%20%E6%9F%A5%E6%89%BE%20value%20%E6%89%80%E5%9C%A8%E7%9A%84%E4%BD%8D%E7%BD%AE%E3%80%82%0A%0A%23%23%23%20%E5%AD%97%E5%85%B8%E7%9A%84%E5%88%9B%E5%BB%BA%E4%B8%8E%E5%88%A0%E9%99%A4%0A-%20%E5%AD%97%E5%85%B8%E7%9A%84%E5%88%9B%E5%BB%BA%0A%60%60%60python%0Ascores%3D%7B%20'%E5%BC%A0%E4%B8%89'%3A100%2C'%E6%9D%8E%E5%9B%9B'%3A98%2C'%E7%8E%8B%E4%BA%94'%3A45%20%7D%0A%60%60%60%0A-%20%E4%BD%BF%E7%94%A8%E5%86%85%E7%BD%AE%E5%87%BD%E6%95%B0%20dict()%0A%60%60%60python%0Adict(name%3D'jack'%2Cage%3D20)%0A%60%60%60%0A%0A%23%23%23%20%E5%AD%97%E5%85%B8%E7%9A%84%E5%B8%B8%E7%94%A8%E6%93%8D%E4%BD%9C%0A-%20%E8%8E%B7%E5%8F%96%E5%AD%97%E5%85%B8%E4%B8%AD%E7%9A%84%E5%85%83%E7%B4%A0%0A1.%20%5B%5D%20%E4%B8%BE%E4%BE%8B%EF%BC%9Ascores%5B'%E5%BC%A0%E4%B8%89'%5D%0A2.%20get()%20%E6%96%B9%E6%B3%95%20%E4%B8%BE%E4%BE%8B%EF%BC%9Ascores.get('%E5%BC%A0%E4%B8%89')%0A%60%60%60python%0Aprint(scores%5B'%E5%BC%A0%E4%B8%89'%5D)%20%23%E5%A6%82%E6%9E%9C%E6%89%BE%E4%B8%8D%E5%88%B0%EF%BC%8C%E5%88%99%E4%BC%9A%E6%8A%9B%E9%94%99%0Aprint(scores.get('%E5%BC%A0%E4%B8%89'))%20%23%E5%A6%82%E6%9E%9C%E6%89%BE%E4%B8%8D%E5%88%B0%EF%BC%8C%E5%88%99%E4%B8%8D%E4%BC%9A%E6%8A%9B%E9%94%99%EF%BC%8C%E8%BF%94%E5%9B%9E%20None%0Aprint(scores.get('%E5%BC%A0%E4%B8%89'%2C'%E9%BB%98%E8%AE%A4%E5%80%BC'))%20%23%E5%A6%82%E6%9E%9C%E6%89%BE%E4%B8%8D%E5%88%B0%EF%BC%8C%E6%8F%90%E4%BE%9B%E9%BB%98%E8%AE%A4%E5%80%BC%0A%60%60%60%0A3.%20key%20%E7%9A%84%E5%88%A4%E6%96%AD%20in%20%E3%80%81not%20in%0A%60%60%60python%0Aprint('%E5%BC%A0%E4%B8%89'%20in%20scores)%0Aprint('%E5%BC%A0%E4%B8%89'%20not%20in%20scores)%0A%60%60%60%0A4.%20%E5%85%83%E7%B4%A0%E5%88%A0%E9%99%A4%E6%93%8D%E4%BD%9C%0A%60%60%60python%0Adel%20scores%5B'%E5%BC%A0%E4%B8%89'%5D%20%23%E5%88%A0%E9%99%A4%E6%8C%87%E5%AE%9A%E7%9A%84%20key-value%20%E5%AF%B9%0A%60%60%60%0A5.%E6%B8%85%E7%A9%BA%E5%AD%97%E5%85%B8%E7%9A%84%E5%85%83%E7%B4%A0%0A%60%60%60python%0Ascores.clear()%0A%60%60%60%0A6.%20%E5%AD%97%E5%85%B8%E5%85%83%E7%B4%A0%E7%9A%84%E6%96%B0%E5%A2%9E%0A%60%60%60python%0Ascores%5B'Jack'%5D%3D90%0A%60%60%60%0A7.%20%E5%AD%97%E5%85%B8%E5%85%83%E7%B4%A0%E7%9A%84%E4%BF%AE%E6%94%B9%0A%60%60%60python%0Ascores%5B'Jack'%5D%3D70%0A%60%60%60%0A%0A%23%23%23%20%E8%8E%B7%E5%8F%96%E5%AD%97%E5%85%B8%E8%A7%86%E5%9B%BE%E7%9A%84%E4%B8%89%E4%B8%AA%E6%96%B9%E6%B3%95%0A1.%20keys()%20%E8%8E%B7%E5%8F%96%E5%AD%97%E5%85%B8%E4%B8%AD%E6%89%80%E6%9C%89%20key%0A2.%20values()%20%E8%8E%B7%E5%8F%96%E5%AD%97%E5%85%B8%E4%B8%AD%E6%89%80%E6%9C%89%20value%0A3.%20items()%20%E8%8E%B7%E5%8F%96%E5%AD%97%E5%85%B8%E4%B8%AD%E6%89%80%E6%9C%89%20key%2Cvalue%20%E5%AF%B9%0A4.%20%E5%B0%86%E5%AD%97%E5%85%B8%E8%BD%AC%E6%8D%A2%E6%88%90%E5%88%97%E8%A1%A8%0A%60%60%60python%0Aitems%3Dscores.items()%0Alist(items)%0A%60%60%60%0A%0A%23%23%23%20%E5%AD%97%E5%85%B8%E5%85%83%E7%B4%A0%E7%9A%84%E9%81%8D%E5%8E%86%0A%60%60%60python%0Afor%20item%20in%20scores%3A%0A%20%20%20%20print(item%2Cscores%5Bitem%5D%2Cscores.get(item))%20%23scores%5Bitem%5D%20%E4%BC%9A%E6%8A%9B%E9%94%99%EF%BC%8Cscores.get(item)%20%E4%B8%8D%E4%BC%9A%0A%60%60%60%0A%0A%23%23%23%20%E5%AD%97%E5%85%B8%E7%9A%84%E7%89%B9%E7%82%B9%0A%3E%20**%E5%AD%97%E5%85%B8%E4%B8%AD%E7%9A%84%E6%89%80%E6%9C%89%E5%85%83%E7%B4%A0%E9%83%BD%E6%98%AF%E4%B8%80%E4%B8%AA%20key-value%20%E5%AF%B9%EF%BC%8Ckey%20%E4%B8%8D%E5%85%81%E8%AE%B8%E9%87%8D%E5%A4%8D%EF%BC%8Cvalue%20%E5%8F%AF%E4%BB%A5%E9%87%8D%E5%A4%8D**%0A%3E%20**%E5%AD%97%E5%85%B8%E4%B8%AD%E7%9A%84%E5%85%83%E7%B4%A0%E6%98%AF%E6%97%A0%E5%BA%8F%E7%9A%84**%0A%3E%20**%E5%AD%97%E5%85%B8%E4%B8%AD%E7%9A%84%20key%20%E5%BF%85%E9%A1%BB%E6%98%AF%E4%B8%8D%E5%8F%AF%E5%8F%98%E5%AF%B9%E8%B1%A1**%0A%3E%20**%E5%AD%97%E5%85%B8%E4%B9%9F%E5%8F%AF%E4%BB%A5%E6%A0%B9%E6%8D%AE%E9%9C%80%E8%A6%81%E5%8A%A8%E6%80%81%E6%BB%B4%E4%BC%B8%E7%BC%A9**%0A%3E%20**%E5%AD%97%E5%85%B8%E4%BC%9A%E6%B5%AA%E8%B4%B9%E8%BE%83%E5%A4%A7%E7%9A%84%E5%86%85%E5%AD%98%EF%BC%8C%E6%98%AF%E4%B8%80%E7%A7%8D%E4%BD%BF%E7%94%A8%E7%A9%BA%E9%97%B4%E6%8D%A2%E6%97%B6%E9%97%B4%E7%9A%84%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84**%0A%0A%23%23%23%20%E5%AD%97%E5%85%B8%E7%94%9F%E6%88%90%E5%BC%8F%0A-%20**%E5%86%85%E7%BD%AE%E5%87%BD%E6%95%B0%20zip()**%0A%E7%94%A8%E4%BA%8E%E5%B0%86%E5%8F%AF%E8%BF%AD%E4%BB%A3%E7%9A%84%E5%AF%B9%E8%B1%A1%E4%BD%9C%E4%B8%BA%E5%8F%82%E6%95%B0%EF%BC%8C%E5%B0%86%E5%AF%B9%E8%B1%A1%E4%B8%AD%E5%AF%B9%E5%BA%94%E7%9A%84%E5%85%83%E7%B4%A0%E6%89%93%E5%8C%85%E6%88%90%E4%B8%80%E4%B8%AA%E5%85%83%E7%BB%84%EF%BC%8C%E7%84%B6%E5%90%8E%E8%BF%94%E5%9B%9E%E7%94%B1%E8%BF%99%E4%BA%9B%E5%85%83%E7%BB%84%E7%BB%84%E6%88%90%E7%9A%84%E5%88%97%E8%A1%A8%0A%60%60%60python%0Aitems%3D%5B'Fruits'%2C'Books'%2C'Others'%5D%0Aprices%3D%5B96%2C78%2C85%5D%0Alst%3Dzip(items%2Cprices)%0Aprint(list(lst))%0A%0Ad%3D%7Bitem.upper()%3Aprice%20for%20item%2Cprice%20in%20zip(items%2Cprices)%7D%20%23%E5%A6%82%E6%9E%9C%E9%94%AE%E5%80%BC%E5%AF%B9%E6%95%B0%E9%87%8F%E4%B8%8D%E5%8C%B9%E9%85%8D%EF%BC%8C%E4%BB%A5%E6%95%B0%E9%87%8F%E5%B0%91%E7%9A%84%E4%B8%80%E6%96%B9%E5%B1%95%E7%A4%BA%0A%60%60%60%0A%0A%23%23%20%E5%85%83%E7%BB%84%0A%3E%20**%60%60%60Python%20%E5%86%85%E7%BD%AE%E7%9A%84%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84%E4%B9%8B%E4%B8%80%EF%BC%8C%E6%98%AF%E4%B8%80%E4%B8%AA%E4%B8%8D%E5%8F%AF%E5%8F%98%E5%BA%8F%E5%88%97%60%60%60**%0A%3E%20**%E4%B8%8D%E5%8F%AF%E5%8F%98%E5%BA%8F%E5%88%97%E5%92%8C%E5%8F%AF%E5%8F%98%E5%BA%8F%E5%88%97**%0A%3E%20**%E4%B8%8D%E5%8F%AF%E5%8F%98%E5%BA%8F%E5%88%97%EF%BC%9A%E5%AD%97%E7%AC%A6%E4%B8%B2%E3%80%81%E5%85%83%E7%BB%84%EF%BC%8C%E6%B2%A1%E6%9C%89%E5%A2%9E%E3%80%81%E5%88%A0%E3%80%81%E6%94%B9%E6%93%8D%E4%BD%9C**%0A%3E%20**%E5%8F%AF%E5%8F%98%E5%BA%8F%E5%88%97%EF%BC%9A%E5%88%97%E8%A1%A8%E3%80%81%E5%AD%97%E5%85%B8%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%AF%B9%E5%BA%8F%E5%88%97%E6%89%A7%E8%A1%8C%E5%A2%9E%E3%80%81%E5%88%A0%E3%80%81%E6%94%B9%E6%93%8D%E4%BD%9C%EF%BC%8C%E5%AF%B9%E8%B1%A1%E5%9C%B0%E5%9D%80%E4%B8%8D%E5%8F%91%E7%94%9F%E6%9B%B4%E6%94%B9**%0A!%5B02362ae3e40fad8468c5f4101a939fb1.png%5D(en-resource%3A%2F%2Fdatabase%2F967%3A1)%0A%0A%23%23%23%20%E5%85%83%E7%BB%84%E7%9A%84%E5%88%9B%E5%BB%BA%E6%96%B9%E5%BC%8F%0A-%20%E7%9B%B4%E6%8E%A5%E5%B0%8F%E6%8B%AC%E5%8F%B7%0A%60%60%60python%0At%3D(%20'Python'%2C'Hello'%2C%2090%20)%0A%60%60%60%0A%0A-%20%E4%BD%BF%E7%94%A8%E5%86%85%E7%BD%AE%E5%87%BD%E6%95%B0%20tuple()%0A%60%60%60python%0At%3Dtuple((%20'Python'%2C'Hello'%2C%2090%20))%0A%60%60%60%0A%0A-%20%E5%8F%AA%E5%8C%85%E5%90%AB%E4%B8%80%E4%B8%AA%E5%85%83%E7%A5%96%E7%9A%84%E5%85%83%E7%B4%A0%E9%9C%80%E8%A6%81%E4%BD%BF%E7%94%A8%E9%80%97%E5%8F%B7%E5%92%8C%E5%B0%8F%E6%8B%AC%E5%8F%B7%0A%60%60%60python%0At%3D(10%2C%20)%0A%60%60%60%0A%0A-%20%E5%8F%AF%E4%BB%A5%E7%AE%80%E5%86%99%E4%B8%BA%0A%60%60%60%20python%0At%3D'Python'%2C'Hello'%2C%2090%0A%60%60%60%0A%0A-%20%E7%A9%BA%E5%85%83%E7%BB%84%E7%9A%84%E5%88%9B%E5%BB%BA%0A%60%60%60python%0At%3D()%0At%3Dtuple()%0A%60%60%60%0A%0A%23%23%23%20%E4%B8%BA%E4%BB%80%E4%B9%88%E8%A6%81%E5%B0%86%E5%85%83%E7%BB%84%E8%AE%BE%E8%AE%A1%E6%88%90%E4%B8%8D%E5%8F%AF%E5%8F%98%E5%BA%8F%E5%88%97%0A-%20**%E5%9C%A8%E5%A4%9A%E4%BB%BB%E5%8A%A1%E7%8E%AF%E5%A2%83%E4%B8%8B%EF%BC%8C%E5%90%8C%E6%97%B6%E6%93%8D%E4%BD%9C%E5%AF%B9%E8%B1%A1%E6%97%B6%E4%B8%8D%E9%9C%80%E8%A6%81%E5%8A%A0%E9%94%81%EF%BC%8C%E5%9B%A0%E6%AD%A4%E5%9C%A8%E7%A8%8B%E5%BA%8F%E4%B8%AD%E5%B0%BD%E9%87%8F%E4%BD%BF%E7%94%A8%E4%B8%8D%E5%8F%AF%E5%8F%98%E5%BA%8F%E5%88%97**%0A-%20**%E6%B3%A8%E6%84%8F%E4%BA%8B%E9%A1%B9%EF%BC%9A%E5%85%83%E7%BB%84%E4%B8%AD%E5%AD%98%E8%BD%A6%E5%A4%84%E7%9A%84%E6%98%AF%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%BC%95%E7%94%A8**%0A%20%20%20%201.%20%E5%A6%82%E6%9E%9C%E5%85%83%E7%BB%84%E4%B8%AD%E5%AF%B9%E8%B1%A1%E6%9C%AC%E8%BA%AB%E4%B8%8D%E5%8F%AF%E5%AF%B9%E8%B1%A1%EF%BC%8C%E5%88%99%E4%B8%8D%E8%83%BD%E5%86%8D%E5%BC%95%E7%94%A8%E5%85%B6%E4%BB%96%E5%AF%B9%E8%B1%A1%0A%20%20%20%202.%20%E5%A6%82%E6%9E%9C%E5%85%83%E7%BB%84%E4%B8%AD%E7%9A%84%E5%AF%B9%E8%B1%A1%E6%98%AF%E5%8F%AF%E5%8F%98%E5%AF%B9%E8%B1%A1%EF%BC%8C%E5%88%99%E5%8F%AF%E5%8F%98%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%BC%95%E7%94%A8%E4%B8%8D%E5%85%81%E8%AE%B8%E6%94%B9%E5%8F%98%EF%BC%8C%E4%BD%86%E6%95%B0%E6%8D%AE%E5%8F%AF%E4%BB%A5%E6%94%B9%E5%8F%98%0A!%5Ba61eafc60ab9acf2cdb512c44d3ca5a2.png%5D(en-resource%3A%2F%2Fdatabase%2F968%3A1)%0A%0A%23%23%23%20%E5%85%83%E7%BB%84%E7%9A%84%E9%81%8D%E5%8E%86%0A-%20**%E5%85%83%E7%BB%84%E6%98%AF%E5%8F%AF%E8%BF%AD%E4%BB%A3%E5%AF%B9%E8%B1%A1%EF%BC%8C%E4%BD%BF%E7%94%A8%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%20for-in%20%E9%81%8D%E5%8E%86**%0A%60%60%60python%0At%3Dtuple('Python'%2C'hello'%2C90)%0Afor%20item%20in%20t%3A%0A%20%20%20%20print(item)%0A%60%60%60%0A%0A%23%23%20%E9%9B%86%E5%90%88%0A-%20**Python%20%E8%AF%AD%E8%A8%80%E6%8F%90%E4%BE%9B%E7%9A%84%E5%86%85%E7%BD%AE%E6%95%B0%E6%8D%AE%E7%BB%93%E6%9E%84**%0A-%20**%E4%B8%8E%E5%88%97%E8%A1%A8%E3%80%81%E5%AD%97%E5%85%B8%E4%B8%80%E6%A0%B7%E9%83%BD%E5%B1%9E%E4%BA%8E%E5%8F%AF%E5%8F%98%E7%B1%BB%E5%9E%8B%E7%9A%84%E5%BA%8F%E5%88%97**%0A-%20**%E9%9B%86%E5%90%88%E6%98%AF%E6%B2%A1%E6%9C%89%20value%20%E7%9A%84%E5%AD%97%E5%85%B8**%0A%0A%23%23%23%20%E9%9B%86%E5%90%88%E7%9A%84%E5%88%9B%E5%BB%BA%E6%96%B9%E5%BC%8F%0A-%20%E7%9B%B4%E6%8E%A5%7B%7D%0A%60%60%60python%0As%3D%7B%20'Python'%2C'hello'%2C90%20%7D%0A%60%60%60%0A%0A-%20%E4%BD%BF%E7%94%A8%E5%86%85%E7%BD%AE%E5%87%BD%E6%95%B0%20set()%0A%60%60%60python%0As%3D%7B%202%2C3%2C4%2C4%2C5%2C5%2C6%2C7%2C7%20%7D%20%23%E9%9B%86%E5%90%88%E4%B8%AD%E7%9A%84%E5%85%83%E7%B4%A0%E4%B8%8D%E5%85%81%E8%AE%B8%E9%87%8D%E5%A4%8D%EF%BC%88%E4%B8%8E%E5%AD%97%E5%85%B8%E7%9B%B8%E5%90%8C%EF%BC%89%0As%3Dset(range(6))%0Aprint(s)%0Aprint(set(%5B3%2C4%2C53%2C56%5D))%20%23%E5%B0%86%E5%88%97%E8%A1%A8%E8%BD%AC%E6%8D%A2%E6%88%90%E9%9B%86%E5%90%88%0Aprint(set(%5B3%2C4%2C43%2C435%5D))%20%23%E5%B0%86%E5%85%83%E7%BB%84%E8%BD%AC%E6%8D%A2%E6%88%90%E9%9B%86%E5%90%88%EF%BC%8C%E5%85%83%E7%B4%A0%E6%98%AF%E6%97%A0%E5%BA%8F%E7%9A%84%0Aprint(set('Python'))%20%23%E5%B0%86%E5%AD%97%E7%AC%A6%E4%B8%B2%E8%BD%AC%E6%8D%A2%E4%B8%BA%E9%9B%86%E5%90%88%EF%BC%8C%E6%8C%89%E5%AD%97%E6%AF%8D%E5%BA%8F%E5%88%97%EF%BC%8C%E6%97%A0%E5%BA%8F%0Aprint(set(%7B124%2C3%2C4%2C4%2C5%7D))%20%23%E9%9B%86%E5%90%88%0Aprint(set())%20%23%E7%A9%BA%E9%9B%86%E5%90%88%0A%60%60%60%0A%0A%23%23%23%20%E9%9B%86%E5%90%88%E5%85%83%E7%B4%A0%E7%9A%84%E5%88%A4%E6%96%AD%E6%93%8D%E4%BD%9C%0A-%20in%20%E6%88%96%20not%20in%0A%60%60%60python%0As%3D%7B10%2C20%2C30%7D%0Aprint(10%20in%20s)%20%23True%0Aprint(10%20not%20in%20s)%20%23False%0A%60%60%60%0A%0A%23%23%23%20%E9%9B%86%E5%90%88%E5%85%83%E7%B4%A0%E7%9A%84%E6%96%B0%E5%A2%9E%E6%93%8D%E4%BD%9C%0A-%20%E8%B0%83%E7%94%A8%20add()%20%E6%96%B9%E6%B3%95%EF%BC%8C%E4%B8%80%E6%AC%A1%E6%B7%BB%E5%8A%A0%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%0A-%20%E8%B0%83%E7%94%A8%20update()%20%E6%96%B9%E6%B3%95%EF%BC%8C%E8%87%B3%E5%B0%91%E6%B7%BB%E5%8A%A0%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%0A%60%60%60python%0As.add(40)%20%23%E6%B7%BB%E5%8A%A0%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%0As.update(%7B60%2C70%2C80%7D)%20%23%E6%B7%BB%E5%8A%A0%E5%A4%9A%E4%B8%AA%E5%85%83%E7%B4%A0%0A%23%20update()%20%E9%87%8C%E8%BF%98%E5%8F%AF%E4%BB%A5%E6%94%BE%E5%85%83%E7%BB%84%E3%80%81%E5%88%97%E8%A1%A8%0A%60%60%60%0A%0A%23%23%23%20%E9%9B%86%E5%90%88%E5%85%83%E7%B4%A0%E7%9A%84%E5%88%A0%E9%99%A4%E6%93%8D%E4%BD%9C%0A-%20%E8%B0%83%E7%94%A8%20remove()%20%E6%96%B9%E6%B3%95%EF%BC%8C%E4%B8%80%E6%AC%A1%E5%88%A0%E9%99%A4%E4%B8%80%E4%B8%AA%E6%8C%87%E5%AE%9A%E5%85%83%E7%B4%A0%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%8C%87%E5%AE%9A%E5%85%83%E7%B4%A0%E4%B8%8D%E5%AD%98%E5%9C%A8%E5%88%99%E6%8A%9B%E5%87%BA%20KeyError%0A-%20%E8%B0%83%E7%94%A8%20discard()%20%E6%96%B9%E6%B3%95%EF%BC%8C%E4%B8%80%E6%AC%A1%E5%88%A0%E9%99%A4%E4%B8%80%E4%B8%AA%E6%8C%87%E5%AE%9A%E5%85%83%E7%B4%A0%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%8C%87%E5%AE%9A%E5%85%83%E7%B4%A0%E4%B8%8D%E5%AD%98%E5%9C%A8%E5%88%99%E4%B8%8D%E4%BC%9A%E6%8A%9B%E5%87%BA%E5%BC%82%E5%B8%B8%0A-%20%E8%B0%83%E7%94%A8%20pop()%20%E6%96%B9%E6%B3%95%EF%BC%8C%E4%B8%80%E6%AC%A1%E5%88%A0%E9%99%A4%E4%B8%80%E4%B8%AA%E4%BB%BB%E6%84%8F%E5%85%83%E7%B4%A0%0A-%20%E8%B0%83%E7%94%A8%20clear()%20%E6%96%B9%E6%B3%95%EF%BC%8C%E6%B8%85%E7%A9%BA%E9%9B%86%E5%90%88%0A%60%60%60python%0As.remove(10)%0As.remove(500)%20%23%E6%8A%A5%E9%94%99%0As.discard(500)%20%23%E4%B8%8D%E4%BC%9A%E6%8A%A5%E9%94%99%0As.pop()%20%23%E5%88%A0%E9%99%A4%E4%BB%BB%E6%84%8F%E5%85%83%E7%B4%A0%EF%BC%8C%E9%9A%8F%E6%9C%BA%E7%9A%84%E5%88%A0%E9%99%A4%E4%B8%80%E4%B8%AA%E5%85%83%E7%B4%A0%EF%BC%8C%E8%AF%A5%E6%96%B9%E6%B3%95%E6%97%A0%E5%8F%82%E6%95%B0%0As.clear()%20%23%E6%B8%85%E7%A9%BA%E9%9B%86%E5%90%88%0A%60%60%60%0A%0A%23%23%23%20%E9%9B%86%E5%90%88%E9%97%B4%E7%9A%84%E5%85%B3%E7%B3%BB%0A%23%23%23%23%20%E4%B8%A4%E4%B8%AA%E9%9B%86%E5%90%88%E6%98%AF%E5%90%A6%E7%9B%B8%E7%AD%89%0A-%20%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E8%BF%90%E7%AE%97%E7%AC%A6%20%3D%3D%20%E6%88%96%20!%3D%20%E5%88%A4%E6%96%AD%0A%60%60%60python%0As1%3D%7B1%2C2%2C3%7D%0As2%3D%7B3%2C2%2C1%7D%0Aprint(s1%3D%3Ds2)%20%23True%0Aprint(s1!%3Ds2)%20%23False%0A%60%60%60%0A%0A%23%23%23%23%20%E4%B8%80%E4%B8%AA%E9%9B%86%E5%90%88%E6%98%AF%E5%90%A6%E6%98%AF%E5%8F%A6%E4%B8%80%E4%B8%AA%E9%9B%86%E5%90%88%E7%9A%84%E5%AD%90%E9%9B%86%E5%90%88%0A-%20%E5%8F%AF%E4%BB%A5%E8%B0%83%E7%94%A8%E6%96%B9%E6%B3%95%20issubset%20%E5%88%A4%E6%96%AD%0A-%20B%20%E6%98%AF%20A%20%E7%9A%84%E5%AD%90%E9%9B%86%0A%60%60%60python%0As1%3D%7B1%2C2%2C3%7D%0As2%3D%7B3%2C2%2C1%7D%0As3%3D%7B1%2C2%2C5%2C6%7D%0Aprint(s2.issubset(s1))%20%23True%0Aprint(s3.issubset(s1))%20%23False%0A%60%60%60%0A%0A%23%23%23%23%20%E4%B8%80%E4%B8%AA%E9%9B%86%E5%90%88%E6%98%AF%E5%90%A6%E6%98%AF%E5%8F%A6%E4%B8%80%E4%B8%AA%E9%9B%86%E5%90%88%E7%9A%84%E8%B6%85%E9%9B%86%0A-%20%E5%8F%AF%E4%BB%A5%E8%B0%83%E7%94%A8%E6%96%B9%E6%B3%95%20issuperset%20%E5%88%A4%E6%96%AD%0A-%20A%20%E6%98%AF%20B%20%E7%9A%84%E8%B6%85%E9%9B%86%0A%60%60%60python%0Aprint(s1.issuperset(s2))%20%23True%0Aprint(s3.issuperset(s2))%20%23False%0A%60%60%60%0A%0A%23%23%23%23%20%E4%B8%A4%E4%B8%AA%E9%9B%86%E5%90%88%E6%98%AF%E5%90%A6%E6%B2%A1%E6%9C%89%E4%BA%A4%E9%9B%86%0A-%20%E5%8F%AF%E4%BB%A5%E8%B0%83%E7%94%A8%E6%96%B9%E6%B3%95%20isdisjoint%20%E5%88%A4%E6%96%AD%0A%60%60%60python%0Aprint(s2.isdisjoint(s3))%20%23False%20%E6%9C%89%E4%BA%A4%E9%9B%86%E4%B8%BA%20False%0As4%3D%7B100%2C200%2C300%7D%0Aprint(s2.isdisjoint(s4))%20%23True%20%E6%B2%A1%E6%9C%89%E4%BA%A4%E9%9B%86%E4%B8%BA%20True%0A%60%60%60%0A%0A%23%23%23%20%E9%9B%86%E5%90%88%E7%9A%84%E6%95%B0%E5%AD%A6%E6%93%8D%E4%BD%9C%0A%23%23%23%23%20%E4%BA%A4%E9%9B%86%20intersection()%0A%60%60%60python%0As1%3D%7B1%2C2%2C3%2C4%2C5%7D%0As2%3D%7B3%2C4%2C5%2C6%2C7%7D%0Aprint(%20s1.intersection(s2)%20)%20%23%E6%89%A7%E8%A1%8C%E7%BB%93%E6%9E%9C%E4%B8%BA%20%7B3%2C4%2C5%7D%0A%23%E7%AE%80%E5%86%99%E4%B8%BA%0Aprint(s1%20%26%20s2)%0A%60%60%60%0A%0A%23%23%23%23%20%E5%B9%B6%E9%9B%86%20union()%0A%60%60%60python%0Aprint(s1.union(s2))%20%23%E6%89%A7%E8%A1%8C%E7%BB%93%E6%9E%9C%E4%B8%BA%20%7B1%2C2%2C3%2C4%2C5%2C6%2C7%7D%20%EF%BC%8C%E5%8E%BB%E6%8E%89%E4%BA%86%E9%87%8D%E5%A4%8D%E7%9A%84%E5%85%83%E7%B4%A0%0A%23%E7%AE%80%E5%86%99%E4%B8%BA%0Aprint(s1%20%7C%20s2)%0A%60%60%60%0A%0A%23%23%23%23%20%E5%B7%AE%E9%9B%86%20difference()%0A%60%60%60python%0Aprint(s1.difference(s2))%20%23%E6%89%A7%E8%A1%8C%E7%BB%93%E6%9E%9C%E4%B8%BA%20%7B1%2C2%7D%0A%23%E7%AE%80%E5%86%99%E4%B8%BA%0Aprint(s1-s2)%0A%60%60%60%0A%0A%23%23%23%23%20%E5%AF%B9%E7%A7%B0%E5%B7%AE%E9%9B%86%20symmetric_difference()%0A%60%60%60python%0Aprint(s1.symmetric_difference(s2))%20%23%E6%89%A7%E8%A1%8C%E7%BB%93%E6%9E%9C%E4%B8%BA%20%7B1%2C2%2C6%2C7%7D%0A%23%E7%AE%80%E5%86%99%E4%B8%BA%0Aprint(s1%5Es2)%0A%60%60%60%0A%0A%23%23%23%20%E9%9B%86%E5%90%88%E7%94%9F%E6%88%90%E5%BC%8F%0A!%5Bc1204dac091ee1a06a44a964df147233.png%5D(en-resource%3A%2F%2Fdatabase%2F969%3A1)%0A%60%60%60python%0As%3D%7Bi*i%20for%20i%20in%20range(10)%7D%0Aprint(s)%0A%60%60%60%0A%0A%23%23%23%20%E6%80%BB%E7%BB%93%E5%88%97%E8%A1%A8%E3%80%81%E5%AD%97%E5%85%B8%E3%80%81%E5%85%83%E7%BB%84%E3%80%81%E9%9B%86%E5%90%88%0A!%5Bbce9169014186fb7a2f9dc5590c9d720.png%5D(en-resource%3A%2F%2Fdatabase%2F971%3A1)%0A!%5B7e800d4be1ffce83c229690c75bbfdb9.png%5D(en-resource%3A%2F%2Fdatabase%2F970%3A1)%0A%0A%23%23%20%E5%AD%97%E7%AC%A6%E4%B8%B2%0A%0A%23%23%23%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%9A%84%E9%A9%BB%E7%95%99%E6%9C%BA%E5%88%B6%0A-%20**%E5%AD%97%E7%AC%A6%E4%B8%B2**%0A-%20%E5%9C%A8%20Python%20%E4%B8%AD%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E5%9F%BA%E6%9C%AC%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B%EF%BC%8C%E6%98%AF%E4%B8%80%E4%B8%AA%E4%B8%8D%E5%8F%AF%E5%8F%98%E7%9A%84%E5%AD%97%E7%AC%A6%E5%BA%8F%E5%88%97%0A%0A-%20**%E4%BB%80%E4%B9%88%E5%8F%AB%E5%AD%97%E7%AC%A6%E4%B8%B2%E9%A9%BB%E7%95%99%E6%9C%BA%E5%88%B6%E5%91%A2%EF%BC%9F**%0A-%20%E4%BB%85%E4%BF%9D%E5%AD%98%E4%B8%80%E4%BB%BD%E7%9B%B8%E5%90%8C%E4%B8%94%E4%B8%8D%E5%8F%AF%E5%8F%98%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%9A%84%E6%96%B9%E6%B3%95%EF%BC%8C%E4%B8%8D%E5%90%8C%E7%9A%84%E5%80%BC%E8%A2%AB%E5%AD%98%E6%94%BE%E5%9C%A8%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%9A%84%E4%B8%BB%E6%B5%81%E6%B1%A0%E4%B8%AD%EF%BC%8CPython%20%E7%9A%84%E4%B8%BB%E6%B5%81%E6%9C%BA%E5%88%B6%E5%AF%B9%E7%9B%B8%E5%90%8C%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%8F%AA%E4%BF%9D%E7%95%99%E4%B8%80%E4%BB%BD%E6%8B%B7%E8%B4%9D%EF%BC%8C%E5%90%8E%E7%BB%AD%E5%88%9B%E5%BB%BA%E7%9B%B8%E5%90%8C%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%97%B6%EF%BC%8C%E4%B8%8D%E4%BC%9A%E5%BC%80%E8%BE%9F%E6%96%B0%E7%A9%BA%E9%97%B4%EF%BC%8C%E8%80%8C%E6%98%AF%E6%8A%8A%E8%AF%A5%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%9A%84%E5%9C%B0%E5%9D%80%E8%B5%8B%E7%BB%99%E6%96%B0%E5%88%9B%E5%BB%BA%E7%9A%84%E5%8F%98%E9%87%8F%0A!%5Bc32233d8f70503cc6390c4fbc904394e.png%5D(en-resource%3A%2F%2Fdatabase%2F1282%3A1)%0A!%5Bd82e7094100432bc30c82be11377c666.png%5D(en-resource%3A%2F%2Fdatabase%2F1283%3A1)%0A%0A-%20**%E9%A9%BB%E7%95%99%E6%9C%BA%E5%88%B6%E7%9A%84%E9%9B%86%E4%B8%AD%E6%83%85%E5%86%B5%EF%BC%88%E4%BA%A4%E4%BA%92%E6%A8%A1%E5%BC%8F%EF%BC%89**%0A1.%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%9A%84%E9%95%BF%E5%BA%A6%E4%B8%BA%200%20%E6%88%96%201%20%E6%97%B6%0A%20%20%20%20-%20%E4%B8%A4%E4%B8%AA%E5%8F%98%E9%87%8F%E8%A6%81%E4%B9%88%E4%B8%BA%E7%A9%BA%200%EF%BC%8C%E8%A6%81%E4%B9%88%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%B8%80%E6%A0%B7%E6%97%B6%201%0A2.%20%E7%AC%A6%E5%90%88%E6%A0%87%E8%AF%86%E7%AC%A6%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%0A%20%20%20%20-%20%E4%BE%8B%E5%A6%82%25%E4%B8%8D%E7%AC%A6%E5%90%88%E6%A0%87%E8%AF%86%E7%AC%A6%EF%BC%8C%E6%89%80%E4%BB%A5%E7%B1%BB%E4%BC%BC%20abc%25%20%20%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%88%9B%E5%BB%BA%E4%B8%A4%E4%B8%AA%EF%BC%8C%E4%B8%BA%E4%B8%A4%E4%B8%AAid%E5%9C%B0%E5%9D%80%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%8C%E5%8D%B3%E5%86%85%E5%AE%B9%E4%B8%80%E6%A0%B7%E5%9C%B0%E5%9D%80%E4%B8%8D%E4%B8%80%E6%A0%B7%0A3.%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%8F%AA%E5%9C%A8%E7%BC%96%E8%AF%91%E6%97%B6%E8%BF%9B%E8%A1%8C%E4%B8%BB%E6%B5%81%EF%BC%8C%E8%80%8C%E9%9D%9E%E8%BF%90%E8%A1%8C%E6%97%B6%0A%60%60%60python%0Aa%3D'abc'%0Ab%3D'ab'%2B'c'%0Ac%3D''.join(%5B'ab'%2C'c'%5D)%0Aprint(a%20is%20b)%20%23True%20a%20%E5%92%8C%20b%20%E6%98%AF%E7%BC%96%E8%AF%91%E6%97%B6%E5%88%9B%E5%BB%BA%E7%9A%84%EF%BC%8C%E5%9C%B0%E5%9D%80%E7%9B%B8%E5%90%8C%0Aprint(a%20is%20c)%20%23False%20c%20%E6%98%AF%E8%BF%90%E8%A1%8C%E6%97%B6%E8%AE%A1%E7%AE%97%E7%9A%84%EF%BC%8C%E6%96%B0%E5%BC%80%E8%BE%9F%E7%9A%84%E5%86%85%E5%AD%98%E7%A9%BA%E9%97%B4%0A%60%60%60%0A4.%20%5B-5%2C265%5D%20%E4%B9%8B%E9%97%B4%E7%9A%84%E6%95%B4%E6%95%B0%E6%95%B0%E5%AD%97%0A%60%60%60python%0Aa%3D-5%0Ab%3D-5%0Aprint(a%20is%20b)%20%23True%20%E5%9C%A8%E6%95%B4%E6%95%B0%E6%95%B0%E5%AD%97%E5%8C%BA%E9%97%B4%E5%86%85%0A%0Aa%3D-6%0Ab%3D-6%0Aprint(a%20is%20b)%20%23False%20%E4%B8%8D%E5%9C%A8%E6%95%B4%E6%95%B0%E6%95%B0%E5%AD%97%E5%8C%BA%E9%97%B4%E5%86%85%0A%60%60%60%0A%0A-%20sys%20%E4%B8%AD%E7%9A%84%20intern%20%E6%96%B9%E6%B3%95%E5%BC%BA%E5%88%B62%E4%B8%AA%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%8C%87%E5%90%91%E5%90%8C%E4%B8%80%E4%B8%AA%E5%AF%B9%E8%B1%A1%0A%60%60%60python%0Aimport%20sys%0Aa%3D'abc%25'%0Aa%3D'abc%25'%0Aprint(a%20is%20b)%20%23False%20%E4%B8%8D%E7%AC%A6%E5%90%88%E6%A0%87%E8%AF%86%E7%AC%A6%E7%9A%84%E4%B8%8D%E9%A9%BB%E7%95%99%0A%0Aa%3Dsys.intern(b)%0Aprint(a%20is%20b)%20%23True%20%E5%BC%BA%E5%88%B6%E9%A9%BB%E7%95%99%0A%60%60%60%0A%0A-%20PyCharm%20%E5%AF%B9%E5%AD%97%E7%AC%A6%E4%B8%B2%E8%BF%9B%E8%A1%8C%E4%BA%86%E4%BC%98%E5%8C%96%E5%A4%84%E7%90%86%0A%0A%23%23%23%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E9%A9%BB%E7%95%99%E6%9C%BA%E5%88%B6%E7%9A%84%E4%BC%98%E7%BC%BA%E7%82%B9%20%0A-%20%E5%BD%93%E9%9C%80%E8%A6%81%E5%80%BC%E7%9B%B8%E5%90%8C%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%97%B6%EF%BC%8C%E5%8F%AF%E4%BB%A5%E7%9B%B4%E6%8E%A5%E4%BB%8E%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%B1%A0%E4%B8%AD%E6%8B%BF%E6%9D%A5%E4%BD%BF%E7%94%A8%EF%BC%8C%E9%81%BF%E5%85%8D%E9%A2%91%E7%B9%81%E5%88%9B%E5%BB%BA%E5%92%8C%E9%94%80%E6%AF%81%EF%BC%8C%E6%8F%90%E5%8D%87%E6%95%88%E7%8E%87%E5%92%8C%E8%8A%82%E7%BA%A6%E5%86%85%E5%AD%98%EF%BC%8C%E5%9B%A0%E6%AD%A4%E6%8B%BC%E6%8E%A5%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%92%8C%E4%BF%AE%E6%94%B9%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E5%9B%9E%E6%AF%94%E8%BE%83%E5%BD%B1%E5%93%8D%E6%80%A7%E8%83%BD%E7%9A%84%0A-%20%E5%9C%A8%E9%9C%80%E8%A6%81%E8%BF%9B%E8%A1%8C%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%8B%BC%E6%8E%A5%E6%97%B6%E5%BB%BA%E8%AE%AE%E4%BD%BF%E7%94%A8%20str%20%E7%B1%BB%E5%9E%8B%E7%9A%84%20join%20%E6%96%B9%E6%B3%95%EF%BC%8C%E8%80%8C%E9%9D%9E%20%2B%EF%BC%8C%E5%9B%A0%E4%B8%BA%20join()%20%E6%96%B9%E6%B3%95%E6%98%AF%E5%85%88%E8%AE%A1%E7%AE%97%E5%87%BA%E6%89%80%E6%9C%89%E5%AD%97%E7%AC%A6%E4%B8%AD%E7%9A%84%E9%95%BF%E5%BA%A6%EF%BC%8C%E7%84%B6%E5%90%8E%E5%86%8D%E6%8B%B7%E8%B4%9D%EF%BC%8C%E5%8F%AA%20new%20%E4%B8%80%E6%AC%A1%E5%AF%B9%E8%B1%A1%EF%BC%8C%E6%95%88%E7%8E%87%E6%AF%94%20%2B%20%E6%95%88%E7%8E%87%E9%AB%98%0A%0A%23%23%23%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%9A%84%E6%9F%A5%E8%AF%A2%E6%93%8D%E4%BD%9C%E6%96%B9%E6%B3%95%0A%23%23%23%23%20index()%0A-%20%E4%BB%8E%E5%B7%A6%E5%BE%80%E5%8F%B3%E6%9F%A5%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%B2%A1%E6%89%BE%E5%88%B0%E5%88%99%E6%8A%9B%E9%94%99%0A%0A%23%23%23%23%20rindex()%0A-%20%E4%BB%8E%E5%8F%B3%E5%BE%80%E5%B7%A6%E6%9F%A5%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%B2%A1%E6%89%BE%E5%88%B0%E5%88%99%E6%8A%9B%E9%94%99%0A%0A%0A%23%23%23%23%20find()%0A-%20%E4%BB%8E%E5%B7%A6%E5%BE%80%E5%8F%B3%E6%9F%A5%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%B2%A1%E6%89%BE%E5%88%B0%E5%88%99%E8%BF%94%E5%9B%9E%20-1%0A%0A%0A%23%23%23%23%20rfind()%0A-%20%E4%BB%8E%E5%8F%B3%E5%BE%80%E5%B7%A6%E6%9F%A5%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%8C%E5%A6%82%E6%9E%9C%E6%B2%A1%E6%89%BE%E5%88%B0%E5%88%99%E8%BF%94%E5%9B%9E%20-1%0A%0A**%E6%8F%90%E7%A4%BA%EF%BC%9A%E6%97%A5%E5%B8%B8%E6%93%8D%E4%BD%9C%E4%B8%AD%E5%B0%BD%E5%8F%AF%E8%83%BD%E4%BD%BF%E7%94%A8%20find()%20%E5%92%8C%20rfind()**%0A%0A%23%23%23%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%9A%84%E5%A4%A7%E5%B0%8F%E5%86%99%E8%BD%AC%E6%8D%A2%E6%93%8D%E4%BD%9C%E6%96%B9%E6%B3%95%0A%23%23%23%23%20upper()%0A-%20%E6%8A%8A%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%B8%AD%E6%89%80%E6%9C%89%E5%AD%97%E7%AC%A6%E9%83%BD%E8%BD%AC%E6%88%90%E5%A4%A7%E5%86%99%E5%AD%97%E6%AF%8D%0A%0A%23%23%23%23%20lower()%0A-%20%E6%8A%8A%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%B8%AD%E6%89%80%E6%9C%89%E5%AD%97%E7%AC%A6%E9%83%BD%E8%BD%AC%E6%88%90%E5%B0%8F%E5%86%99%E5%AD%97%E6%AF%8D%0A%0A%23%23%23%23%20swapcase()%0A-%20%E6%8A%8A%E5%AD%97%E7%AC%A6%E4%B8%B2%E4%B8%AD%E6%89%80%E6%9C%89%E5%A4%A7%E5%86%99%E5%AD%97%E6%AF%8D%E8%BD%AC%E6%88%90%E5%B0%8F%E5%86%99%E5%AD%97%E6%AF%8D%EF%BC%8C%E6%8A%8A%E6%89%80%E6%9C%89%E5%B0%8F%E5%A7%90%E5%AD%97%E6%AF%8D%E8%BD%AC%E6%88%90%E5%A4%A7%E5%86%99%E5%AD%97%E6%AF%8D%0A%60%60%60python%0Aprint('Hello%2Cworld'.swapcase())%20%23%20hELLO%2CWORLD%0A%60%60%60%0A%0A%23%23%23%23%20capitalize()%0A-%20%E6%8A%8A%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E8%BD%AC%E6%88%90%E5%A4%A7%E5%86%99%EF%BC%8C%E6%8A%8A%E5%85%B6%E4%BD%99%E5%AD%97%E7%AC%A6%E8%BD%AC%E6%88%90%E5%B0%8F%E5%86%99%0A%60%60%60python%0Aprint('Hello'.capitalize())%20%23%20Hello%0A%60%60%60%0A%0A%23%23%23%23%20title()%0A-%20%E6%8A%8A%E6%AF%8F%E4%B8%AA%E5%8D%95%E8%AF%8D%E7%9A%84%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AD%97%E7%AC%A6%E8%BD%AC%E6%88%90%E5%A4%A7%E5%86%99%EF%BC%8C%E6%8A%8A%E6%AF%8F%E4%B8%AA%E5%8D%95%E8%AF%8D%E7%9A%84%E5%89%A9%E4%BD%99%E5%AD%97%E7%AC%A6%E8%BD%AC%E6%88%90%E5%B0%8F%E5%86%99%0A%60%60%60python%0Aprint('Hello%20world'.swapcase())%20%23%20Hello%20World%0A%60%60%60%0A%0A%23%23%23%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%86%85%E5%AE%B9%E5%AF%B9%E9%BD%90%E6%93%8D%E4%BD%9C%0A%23%23%23%23%20center()%0A%0A%23%23%23%23%20ljust()%0A%0A%0A%23%23%23%23%20rjust()%0A!%5B5c6e13bc3539488a6cb2ba7efdf82c04.png%5D(en-resource%3A%2F%2Fdatabase%2F1284%3A1)%0A%0A%0A%23%23%23%23%20zfill()%0A-%20%E5%8F%B3%E5%AF%B9%E9%BD%90%EF%BC%8C%E4%BD%BF%E7%94%A80%E8%BF%9B%E8%A1%8C%E5%A1%AB%E5%85%85%0A%0A%23%23%23%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%8A%88%E5%88%86%E6%93%8D%E4%BD%9C%0A%23%23%23%23%20split()%0A-%20%E4%BB%8E%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%B7%A6%E8%BE%B9%E5%BC%80%E5%A7%8B%E5%8A%88%E5%88%86%EF%BC%8C%E9%BB%98%E8%AE%A4%E7%9A%84%E5%8A%88%E5%88%86%E5%AD%97%E7%AC%A6%E6%98%AF%E7%A9%BA%E6%A0%BC%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%8C%E8%BF%94%E5%9B%9E%E7%9A%84%E5%80%BC%E9%83%BD%E6%98%AF%E4%B8%80%E4%B8%AA%E5%88%97%E8%A1%A8%0A-%20%E4%BB%A5%E9%80%9A%E8%BF%87%E5%8F%82%E6%95%B0%20sep%20%E6%8C%87%E5%AE%9A%E5%8A%88%E5%88%86%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E7%9A%84%E5%8A%88%E5%88%86%E7%AC%A6%0A-%20%E9%80%9A%E8%BF%87%E5%8F%82%E6%95%B0%20maxsplit%20%E6%8C%87%E5%AE%9A%E5%8A%88%E5%88%86%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%97%B6%E7%9A%84%E6%9C%80%E5%A4%A7%E5%8A%88%E5%88%86%E6%AC%A1%E6%95%B0%EF%BC%8C%E5%9C%A8%E7%BB%8F%E8%BF%87%E6%9C%80%E5%A4%A7%E6%AC%A1%E5%8A%88%E5%88%86%E5%90%8E%EF%BC%8C%E5%89%A9%E4%BD%99%E7%9A%84%E5%AD%90%E4%B8%B2%E4%BC%9A%E5%8D%95%E7%8B%AC%E4%BD%9C%E4%B8%BA%E4%B8%80%E9%83%A8%E5%88%86%0A%0A%23%23%23%23%20rsplit()%0A-%20%E4%BB%8E%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%8F%B3%E8%BE%B9%E5%BC%80%E5%A7%8B%E5%8A%88%E5%88%86%EF%BC%8C%E9%BB%98%E8%AE%A4%E7%9A%84%E5%8A%88%E5%88%86%E5%AD%97%E7%AC%A6%E6%98%AF%E7%A9%BA%E6%A0%BC%E5%AD%97%E7%AC%A6%E4%B8%B2%EF%BC%8C%E8%BF%94%E5%9B%9E%E7%9A%84%E5%80%BC%E9%83%BD%E6%98%AF%E4%B8%80%E4%B8%AA%E5%88%97%E8%A1%A8%0A-%20%E4%BB%A5%E9%80%9A%E8%BF%87%E5%8F%82%E6%95%B0%20sep%20%E6%8C%87%E5%AE%9A%E5%8A%88%E5%88%86%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E7%9A%84%E5%8A%88%E5%88%86%E7%AC%A6%0A-%20%E9%80%9A%E8%BF%87%E5%8F%82%E6%95%B0%20maxsplit%20%E6%8C%87%E5%AE%9A%E5%8A%88%E5%88%86%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%97%B6%E7%9A%84%E6%9C%80%E5%A4%A7%E5%8A%88%E5%88%86%E6%AC%A1%E6%95%B0%EF%BC%8C%E5%9C%A8%E7%BB%8F%E8%BF%87%E6%9C%80%E5%A4%A7%E6%AC%A1%E5%8A%88%E5%88%86%E5%90%8E%EF%BC%8C%E5%89%A9%E4%BD%99%E7%9A%84%E5%AD%90%E4%B8%B2%E4%BC%9A%E5%8D%95%E7%8B%AC%E4%BD%9C%E4%B8%BA%E4%B8%80%E9%83%A8%E5%88%86%0A%0A%23%23%23%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%88%A4%E6%96%AD%E6%93%8D%E4%BD%9C%0A%23%23%23%23%20isidentifier()%0A-%20%E5%88%A4%E6%96%AD%E6%8C%87%E5%AE%9A%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E5%90%A6%E5%90%88%E6%B3%95%E6%A0%87%E8%AF%86%E7%AC%A6%0A%0A%23%23%23%23%20isspace()%0A-%20%E5%88%A4%E6%96%AD%E6%8C%87%E5%AE%9A%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E5%90%A6%E5%85%A8%E9%83%A8%E7%94%B1%E7%A9%BA%E7%99%BD%E5%AD%97%E7%AC%A6%E7%BB%84%E6%88%90%0A!%5B8fc15f3e4ba0a07b650d5695b6a9542d.png%5D(en-resource%3A%2F%2Fdatabase%2F1288%3A1)%0A%0A%23%23%23%23%20isalpha()%0A-%20%E5%88%A4%E6%96%AD%E6%8C%87%E5%AE%9A%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E5%90%A6%E5%85%A8%E9%83%A8%E7%94%B1%E5%AD%97%E6%AF%8D%E7%BB%84%E6%88%90%0A!%5B8b5f8b238c43f2c690e1d7d61d79f71b.png%5D(en-resource%3A%2F%2Fdatabase%2F1287%3A1)%0A%0A%23%23%23%23%20isdecimal()%0A-%20%E5%88%A4%E6%96%AD%E6%8C%87%E5%AE%9A%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E5%90%A6%E5%85%A8%E9%83%A8%E7%94%B1%E5%8D%81%E8%BF%9B%E5%88%B6%E7%9A%84%E6%95%B0%E5%AD%97%E7%BB%84%E6%88%90%0A!%5B7fa8dbec5f363f0d49f2718c67052f8e.png%5D(en-resource%3A%2F%2Fdatabase%2F1286%3A1)%0A%0A%23%23%23%23%20isnumeric()%0A-%20%E5%88%A4%E6%96%AD%E6%8C%87%E5%AE%9A%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E5%90%A6%E5%85%A8%E9%83%A8%E7%94%B1%E6%95%B0%E5%AD%97%E7%BB%84%E6%88%90%0A!%5B1a1a067c3b3d4fb6e9134805a2439eb5.png%5D(en-resource%3A%2F%2Fdatabase%2F1285%3A1)%0A%0A%23%23%23%23%20isalnum()%0A-%20%E5%88%A4%E6%96%AD%E6%8C%87%E5%AE%9A%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%98%AF%E5%90%A6%E5%85%A8%E9%83%A8%E7%94%B1%E5%AD%97%E6%AF%8D%E5%92%8C%E6%95%B0%E5%AD%97%E7%BB%84%E6%88%90%0A!%5Bcf24cd2c1902f7d353edc4b17e805181.png%5D(en-resource%3A%2F%2Fdatabase%2F1289%3A1)%0A%0A%23%23%23%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%85%B6%E4%BB%96%E7%9A%84%E6%93%8D%E4%BD%9C%E6%96%B9%E6%B3%95%0A%23%23%23%23%20replace()%0A-%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E6%9B%BF%E6%8D%A2%0A!%5B3e57305f599d75546da43e06a063ac47.png%5D(en-resource%3A%2F%2Fdatabase%2F1290%3A1)%0A%0A%23%23%23%23%20join()%0A-%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%90%88%E5%B9%B6%0A!%5Bb2b794f35db2cb147406519a272cd5d3.png%5D(en-resource%3A%2F%2Fdatabase%2F1292%3A1)%0A%0A%23%23%23%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%9A%84%E6%AF%94%E8%BE%83%E6%93%8D%E4%BD%9C%0A-%20**%E8%BF%90%E7%AE%97%E7%AC%A6%20%3E%20%3E%3D%20%3C%20%3C%3D%20%3D%3D%20!%3D**%0A!%5B639f175a3cfb257488ffbbb6de5cdc5f.png%5D(en-resource%3A%2F%2Fdatabase%2F1291%3A1)%0A!%5Bcbcbd4642e86fbc606c6f9ba69894c5e.png%5D(en-resource%3A%2F%2Fdatabase%2F1294%3A1)%0A!%5B158570f1d8cb3fa4d2a5a57ad4111f42.png%5D(en-resource%3A%2F%2Fdatabase%2F1293%3A1)%0A%0A%23%23%23%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%9A%84%E5%88%87%E7%89%87%E6%93%8D%E4%BD%9C%0A!%5Bfe397f7ca1d5c0bc996eb1385046db06.png%5D(en-resource%3A%2F%2Fdatabase%2F1295%3A1)%0A-%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E5%88%87%E7%89%87%E5%90%8E%E9%83%BD%E5%B0%86%E4%BA%A7%E7%94%9F%E6%96%B0%E7%9A%84%E5%86%85%E5%AD%98%E5%AF%B9%E8%B1%A1%0A%0A%23%23%23%20%E6%A0%BC%E5%BC%8F%E5%8C%96%E5%AD%97%E7%AC%A6%E4%B8%B2%0A!%5B0b7ac1859c5374af54a7a9863b81bfb3.png%5D(en-resource%3A%2F%2Fdatabase%2F1296%3A1)%0A%60%60%60python%0Aname%3D'%E5%BC%A0%E4%B8%89'%0Aage%3D20%0Aprint('%E6%88%91%E5%8F%AB%25s%EF%BC%8C%E4%BB%8A%E5%B9%B4%25d%E5%B2%81'%20%25%20(name%2Cage))%0Aprint('%E6%88%91%E5%8F%AB%7B0%7D%EF%BC%8C%E4%BB%8A%E5%B9%B4%7B1%7D%E5%B2%81'.format(name%2Cage))%0Aprint(f'%E6%88%91%E5%8F%AB%7Bname%7D%EF%BC%8C%E4%BB%8A%E5%B9%B4%7Bage%7D%E5%B2%81')%0Aprint('%2510d'%20%25%2099)%20%23%2010%E8%A1%A8%E7%A4%BA%E5%AE%BD%E5%BA%A6%0Aprint('%25.3f'%20%25%203.1415926)%20%23%20%E8%A1%A8%E7%A4%BA%E7%B2%BE%E5%BA%A6%EF%BC%8C%E4%BF%9D%E7%95%993%E4%BD%8D%E5%B0%8F%E6%95%B0%0Aprint('%7B0%3A.3f%7D'.format(3.1415926))%20%23%E8%A1%A8%E7%A4%BA%E7%B2%BE%E5%BA%A6%EF%BC%8C%E4%BF%9D%E7%95%993%E4%BD%8D%E5%B0%8F%E6%95%B0%0A%0Aprint('%7B0%3A.3%7D'.format(3.1415926))%20%23%E8%A1%A8%E7%A4%BA%E4%B8%80%E5%85%B1%E6%98%AF3%E4%BD%8D%E6%95%B0%0A%0Aprint('%2510.3f'%20%25%203.1415926)%20%23%E5%90%8C%E6%97%B6%E8%A1%A8%E7%A4%BA%E5%AE%BD%E5%BA%A6%E3%80%81%E7%B2%BE%E5%BA%A6%0Aprint('%7B0%3A10.3f%7D'.format(3.1415926))%20%23%E5%90%8C%E6%97%B6%E8%A1%A8%E7%A4%BA%E5%AE%BD%E5%BA%A6%E3%80%81%E7%B2%BE%E5%BA%A6%0A%60%60%60%0A%0A%23%23%23%20%E5%AD%97%E7%AC%A6%E4%B8%B2%E7%9A%84%E7%BC%96%E7%A0%81%E8%BD%AC%E6%8D%A2%0A!%5Bf285f89a58ba1025e5c1e3e65cb007ad.png%5D(en-resource%3A%2F%2Fdatabase%2F1297%3A1)%0A!%5B5359eb46d991ac6508e221b0fd479a93.png%5D(en-resource%3A%2F%2Fdatabase%2F1298%3A1)%0A%0A%23%23%20%E5%87%BD%E6%95%B0%0A%23%23%23%20%E5%87%BD%E6%95%B0%E7%9A%84%E5%88%9B%E5%BB%BA%E5%92%8C%E8%B0%83%E7%94%A8%0A-%20%E5%87%BD%E6%95%B0%E5%B0%B1%E6%98%AF%E6%89%A7%E8%A1%8C%E7%89%B9%E5%AE%9A%E4%BB%BB%E4%BD%95%E4%BB%A5%E5%AE%8C%E6%88%90%E7%89%B9%E5%AE%9A%E5%8A%9F%E8%83%BD%E7%9A%84%E4%B8%80%E6%AE%B5%E4%BB%A3%E7%A0%81%0A-%20%E4%B8%BA%E4%BB%80%E4%B9%88%E9%9C%80%E8%A6%81%E5%87%BD%E6%95%B0%0A%20%20%20%201.%20%E6%9C%8D%E7%94%A8%E4%BB%A3%E7%A0%81%0A%20%20%20%202.%20%E9%9A%90%E8%97%8F%E5%AE%9E%E7%8E%B0%E7%BB%86%E8%8A%82%0A%20%20%20%203.%20%E6%8F%90%E9%AB%98%E5%8F%AF%E7%BB%B4%E6%8A%A4%E6%80%A7%0A%20%20%20%204.%20%E6%8F%90%E9%AB%98%E5%8F%AF%E8%AF%BB%E6%80%A7%E4%BE%BF%E4%BA%8E%E8%B0%83%E8%AF%95%0A!%5Ba55adfd2be70439534101bb694e25b2f.png%5D(en-resource%3A%2F%2Fdatabase%2F1300%3A1)%0A%60%60%60python%0A%23%E5%88%9B%E5%BB%BA%E5%87%BD%E6%95%B0%0Adef%20calc(a%2Cb)%3A%20%23%20%E5%BD%A2%E5%8F%82%EF%BC%8C%E5%BD%A2%E5%BC%8F%E5%8F%82%E6%95%B0%0A%20%20%20%20c%3Da%2Bb%0A%20%20%20%20return%20c%0A%0Aresult%3Dcalc(10%2C20)%20%23%E5%AE%9E%E5%8F%82%EF%BC%8C%E5%AE%9E%E5%8F%82%E7%9A%84%E4%BD%8D%E7%BD%AE%E6%98%AF%E5%87%BD%E6%95%B0%E7%9A%84%E8%B0%83%E7%94%A8%E5%A4%84%0Aprint(result)%0A%60%60%60%0A%0A%23%23%23%20%E5%87%BD%E6%95%B0%E7%9A%84%E5%8F%82%E6%95%B0%E4%BC%A0%E9%80%92%0A-%20**%E4%B8%A4%E7%A7%8D%E4%BC%A0%E9%80%92%E6%96%B9%E5%BC%8F**%0A-%20%E4%BD%8D%E7%BD%AE%E5%AE%9E%E5%8F%82%EF%BC%9A%E6%A0%B9%E6%8D%AE%E5%BD%A2%E5%8F%82%E5%AF%B9%E5%BA%94%E7%9A%84%E4%BD%8D%E7%BD%AE%E8%BF%9B%E8%A1%8C%E5%AE%9E%E5%8F%82%E4%BC%A0%E9%80%92%0A-%20%E5%85%B3%E9%94%AE%E5%AD%97%E5%AE%9E%E5%8F%82%EF%BC%9A%E6%A0%B9%E6%8D%AE%E5%BD%A2%E5%8F%82%E5%90%8D%E7%A7%B0%E8%BF%9B%E8%A1%8C%E5%AE%9E%E5%8F%82%E4%BC%A0%E9%80%92%0A%60%60%60python%0A%23%E4%BD%8D%E7%BD%AE%E5%AE%9E%E5%8F%82%0Adef%20calc(a%2Cb)%3A%0Acalc(10%2C20)%0A%0A%23%E5%85%B3%E9%94%AE%E5%AD%97%E5%AE%9E%E5%8F%82%0Adef%20calc(b%3D20%2Ca%3D10)%3A%0Acalc(10%2C20)%0A%60%60%60%0A%0A-%20**%E5%8F%82%E6%95%B0%E4%BC%A0%E9%80%92%E5%86%85%E5%AD%98%E5%88%86%E6%9E%90%E5%9B%BE**%0A!%5B3ac317799f1e67c8ab05cf4f48e10834.png%5D(en-resource%3A%2F%2Fdatabase%2F1302%3A1)%0A%0A-%20**%E5%87%BD%E6%95%B0%E8%BF%94%E5%9B%9E%E5%A4%9A%E4%B8%AA%E5%80%BC%E6%97%B6%EF%BC%8C%E7%BB%93%E6%9E%9C%E4%B8%BA%E5%85%83%E7%BB%84**%0A%60%60%60python%0A%23%201.%E6%97%A0%E8%BF%94%E5%9B%9E%E5%80%BC%E7%9A%84%E5%87%BD%E6%95%B0%EF%BC%8C%E4%B8%8D%E7%94%A8%E5%86%99%20return%0Adef%20fun1()%3A%0A%20%20%20%20print('hello')%0A%0A%23%202.%E6%9C%891%E4%B8%AA%E8%BF%94%E5%9B%9E%E5%80%BC%E7%9A%84%E5%87%BD%E6%95%B0%EF%BC%8C%E8%BF%94%E5%9B%9E%E7%B1%BB%E5%9E%8B%E4%B8%BA%E5%8E%9F%E7%B1%BB%E5%9E%8B%EF%BC%8C%E7%A4%BA%E4%BE%8B%E4%B8%AD%E8%BF%94%E5%9B%9E%E7%9A%84%E6%98%AF%20str%0Adef%20fun2()%3A%0A%20%20%20%20return%20'hello'%0Ares%3Dfun2()%0A%0A%23%203.%E8%BF%94%E5%9B%9E%E5%A4%9A%E4%B8%AA%E5%80%BC%EF%BC%8C%E8%BF%94%E5%9B%9E%E7%B1%BB%E5%9E%8B%E4%B8%BA%E5%85%83%E7%BB%84%0Adef%20fun3()%3A%0A%20%20%20%20return%20'hello'%2C'world'%0Aprint(fun3())%0A%0A%23%20%E5%87%BD%E6%95%B0%E5%9C%A8%E5%AE%9A%E4%B9%89%E6%97%B6%EF%BC%8C%E6%98%AF%E5%90%A6%E9%9C%80%E8%A6%81%E8%BF%94%E5%9B%9E%E5%80%BC%EF%BC%8C%E8%A7%86%E6%83%85%E5%86%B5%E8%80%8C%E5%AE%9A%0A%60%60%60%0A%0A%23%23%23%20%E5%87%BD%E6%95%B0%E7%9A%84%E5%8F%82%E6%95%B0%E5%AE%9A%E4%B9%89%0A-%20**%E5%87%BD%E6%95%B0%E5%AE%9A%E4%B9%89%E9%BB%98%E8%AE%A4%E5%80%BC%E5%8F%82%E6%95%B0**%0A-%20%E7%BB%99%E5%BD%A2%E5%8F%82%E8%AE%BE%E7%BD%AE%E9%BB%98%E8%AE%A4%E5%80%BC%EF%BC%8C%E5%8F%AA%E6%9C%89%E4%B8%8E%E9%BB%98%E8%AE%A4%E5%80%BC%E4%B8%8D%E7%AC%A6%E7%9A%84%E6%83%85%E5%86%B5%E6%89%8D%E9%9C%80%E8%A6%81%E4%BC%A0%E9%80%92%E5%AE%9E%E5%8F%82%0A%60%60%60python%0Adef%20fun(a%2Cb%3D100)%3A%0A%20%20%20%20print(a%2Cb)%0A%0Afun(100)%20%23%20%E5%BD%93%E6%B2%A1%E6%9C%89%E7%BB%99%E5%8F%82%E6%95%B0%20b%20%E4%BC%A0%E5%80%BC%E6%97%B6%EF%BC%8Cb%20%E9%BB%98%E8%AE%A4%E5%80%BC%20100%0Afun(20%2C30)%0A%60%60%60%0A%0A-%20**%E4%B8%AA%E6%95%B0%E5%8F%AF%E5%8F%98%E7%9A%84%E4%BD%8D%E7%BD%AE%E5%8F%82%E6%95%B0**%0A-%20%E5%AE%9A%E4%B9%89%E5%87%BD%E6%95%B0%E6%97%B6%EF%BC%8C%E5%8F%AF%E8%83%BD%E6%97%A0%E6%B3%95%E5%AE%9E%E7%8E%B0%E7%A1%AE%E5%AE%9A%E4%BC%A0%E9%80%92%E7%9A%84%E4%BD%8D%E7%BD%AE%E5%AE%9E%E5%8F%82%E7%9A%84%E4%B8%AA%E6%95%B0%E6%97%B6%EF%BC%8C%E4%BD%BF%E7%94%A8%E5%8F%AF%E5%8F%98%E7%9A%84%E4%BD%8D%E7%BD%AE%E5%8F%82%E6%95%B0%0A-%20%E4%BD%BF%E7%94%A8%20*%20%E5%AE%9A%E4%B9%89%E4%B8%AA%E6%95%B0%E5%8F%AF%E5%8F%98%E7%9A%84%E4%BD%8D%E7%BD%AE%E5%BD%A2%E5%8F%82%0A-%20%E7%BB%93%E6%9E%9C%E4%B8%BA%E4%B8%80%E4%B8%AA%E5%85%83%E7%BB%84%0A%60%60%60python%0A%23%20%E5%AE%9A%E4%B9%89%E5%8F%AF%E5%8F%98%E7%9A%84%E4%BD%8D%E7%BD%AE%E5%8F%82%E6%95%B0%0Adef%20fun(*args)%3A%0A%20%20%20%20print(args)%0A%23%20%E8%B0%83%E7%94%A8%E5%87%BD%E6%95%B0%EF%BC%8C%E4%BC%A0%E5%85%A5%E4%B8%8D%E5%90%8C%E4%B8%AA%E6%95%B0%E7%9A%84%E5%8F%82%E6%95%B0%EF%BC%8C%E8%BE%93%E5%87%BA%E7%9A%84%E6%98%AF%E5%85%83%E7%BB%84%0Afun(10)%0Afun(10%2C30)%0Afun(10%2C30%2C50)%0A%60%60%60%0A%0A-%20%E4%B8%AA%E6%95%B0%E5%8F%AF%E5%8F%98%E7%9A%84%E5%85%B3%E9%94%AE%E5%AD%97%E5%BD%A2%E5%8F%82%0A-%20%E5%AE%9A%E4%B9%89%E5%87%BD%E6%95%B0%E6%97%B6%EF%BC%8C%E6%97%A0%E6%B3%95%E4%BA%8B%E5%85%88%E7%A1%AE%E5%AE%9A%E4%BC%A0%E9%80%92%E7%9A%84%E5%85%B3%E9%94%AE%E5%AD%97%E5%AE%9E%E5%8F%82%E7%9A%84%E4%B8%AA%E6%95%B0%E6%97%B6%EF%BC%8C%E4%BD%BF%E7%94%A8%E5%8F%AF%E5%8F%98%E7%9A%84%E5%85%B3%E9%94%AE%E5%AD%97%E5%BD%A2%E5%8F%82%0A-%20%E4%BD%BF%E7%94%A8%20**%20%E5%AE%9A%E4%B9%89%E4%B8%AA%E6%95%B0%E5%8F%AF%E5%8F%98%E7%9A%84%E5%85%B3%E9%94%AE%E5%AD%97%E5%BD%A2%E5%8F%82%0A-%20%E7%BB%93%E6%9E%9C%E4%B8%BA%E4%B8%80%E4%B8%AA%E5%AD%97%E5%85%B8%0A%60%60%60python%0A%0Adef%20fun1(**args)%3A%0A%20%20%20%20print(args)%0A%0Afun1(a%3D10)%20%23%20%E7%BB%93%E6%9E%9C%E4%B8%BA%E5%AD%97%E5%85%B8%E7%B1%BB%E5%9E%8B%EF%BC%8C%7B'a'%3A10%7D%0Afun1(a%3D20%2Cb%3D30%2Cc%3D40)%20%20%23%20%E7%BB%93%E6%9E%9C%E4%B8%BA%E5%AD%97%E5%85%B8%E7%B1%BB%E5%9E%8B%EF%BC%8C%7B'a%3A20%2C'b'%3A30%2C'c'%3A40%7D%0A%60%60%60%0A%0A-%20**%E5%9C%A8%E5%87%BD%E6%95%B0%E5%AE%9A%E4%B9%89%E5%8F%82%E6%95%B0%E6%97%B6%EF%BC%8C%E4%B8%A4%E7%A7%8D%E7%B1%BB%E5%9E%8B%E7%9A%84%E5%8F%82%E6%95%B0%E5%8F%AA%E8%83%BD%E5%90%84%E8%87%AA%E5%AE%9A%E4%B9%89%E4%B8%80%E4%B8%AA**%0A-%20**%E4%BD%86%E4%B8%A4%E4%B8%AA%E7%B1%BB%E5%9E%8B%E7%9A%84%E5%8F%82%E6%95%B0%E5%8F%AF%E4%BB%A5%E5%90%8C%E6%97%B6%E5%87%BA%E7%8E%B0%E5%9C%A8%E4%B8%80%E4%B8%AA%E5%87%BD%E6%95%B0%E5%8F%82%E6%95%B0%E5%86%85%EF%BC%8C%E4%BD%86%E9%A1%BA%E5%BA%8F%E6%98%AF%E4%B8%AA%E6%95%B0%E5%8F%AF%E5%8F%98%E7%9A%84%E4%BD%8D%E7%BD%AE%E5%8F%82%E6%95%B0%E5%AE%9A%E4%B9%89%E5%9C%A8%E5%89%8D%EF%BC%8C%E4%B8%AA%E6%95%B0%E5%8F%AF%E5%8F%98%E7%9A%84%E5%85%B3%E9%94%AE%E5%AD%97%E5%BD%A2%E5%8F%82%E5%AE%9A%E4%B9%89%E5%9C%A8%E5%90%8E**%0A%60%60%60python%0A%23%20%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%8F%82%E6%95%B0%E4%B8%BA%E5%8F%AF%E5%8F%98%E7%9A%84%E4%BD%8D%E7%BD%AE%E5%8F%82%E6%95%B0%EF%BC%8C%E7%AC%AC%E4%BA%8C%E4%B8%AA%E5%8F%82%E6%95%B0%E4%B8%BA%E5%8F%AF%E5%8F%98%E7%9A%84%E5%85%B3%E9%94%AE%E5%AD%97%E5%8F%82%E6%95%B0%0Adef%20fun3(*args1%2C**args2)%3A%0A%60%60%60%0A%0A%23%23%23%20%E5%87%BD%E6%95%B0%E7%9A%84%E5%8F%82%E6%95%B0%E6%80%BB%E7%BB%93%0A!%5Bb002509e5164b25834a2e5af4dcb53d2.png%5D(en-resource%3A%2F%2Fdatabase%2F1304%3A1)%0A%0A%23%23%23%20%E5%8F%98%E9%87%8F%E7%9A%84%E4%BD%9C%E7%94%A8%E5%9F%9F%0A%23%23%23%23%20%E5%AE%9A%E4%B9%89%E5%87%BD%E6%95%B0%0A-%20%E5%B1%80%E9%83%A8%E5%8F%98%E9%87%8F%0A%20%20%20%20-%20%E5%9C%A8%E5%87%BD%E6%95%B0%E5%86%85%E5%AE%9A%E4%B9%89%E5%B9%B6%E4%BD%BF%E7%94%A8%E7%9A%84%E5%8F%98%E9%87%8F%EF%BC%8C%E5%8F%AA%E5%9C%A8%E5%87%BD%E6%95%B0%E5%86%85%E9%83%A8%E6%B8%B8%E9%80%8D%EF%BC%8C%E5%B1%80%E9%83%A8%E5%8F%98%E9%87%8F%E4%BD%BF%E7%94%A8%20global%20%E5%A3%B0%E6%98%8E%EF%BC%8C%E8%BF%99%E4%B8%AA%E5%8F%98%E9%87%8F%E5%B0%B1%E4%BC%9A%E5%8F%98%E6%88%90%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F%0A-%20%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F%0A%20%20%20%20-%20%E5%87%BD%E6%95%B0%E4%BD%93%E5%A4%96%E5%AE%9A%E4%B9%89%E7%9A%84%E5%8F%98%E9%87%8F%EF%BC%8C%E5%8F%AF%E4%BD%9C%E7%94%A8%E4%BA%8E%E5%87%BD%E6%95%B0%E5%86%85%E5%A4%96%0A%60%60%60python%0Adef%20fun(a%2Cb)%3A%20%20%20%23%20a%20%2C%20b%20%E4%B8%BA%E5%87%BD%E6%95%B0%E7%9A%84%E5%BD%A2%E5%8F%82%0A%20%20%20%20c%3Da%2Bb%20%20%20%23%20c%20%E5%B1%80%E9%83%A8%E5%8F%98%E9%87%8F%0A%20%20%20%20print(c)%0A%0Aname%3D'%E6%9D%A8%E8%80%81%E5%B8%88'%20%20%23%20name%20%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F%0Adef%20fun2()%3A%0A%20%20%20%20print(name)%0A%0Adef%20fun3()%3A%0A%20%20%20%20global%20age%20%20%23%20%E5%9C%A8%E5%87%BD%E6%95%B0%E4%BD%93%E5%86%85%E5%AE%9A%E4%B9%89%E7%9A%84%E5%85%A8%E5%B1%80%E5%8F%98%E9%87%8F%0A%20%20%20%20age%20%3D%2020%0A%20%20%20%20print(age)%0A%0Afun3()%0Aprint(age)%20%20%23%E5%9C%A8%E5%A4%96%E9%83%A8%E4%B9%9F%E5%8F%AF%E4%BB%A5%E8%AE%BF%E9%97%AE%E8%AF%A5%E5%8F%98%E9%87%8F%0A%60%60%60%0A%0A%23%23%23%23%20%E9%80%92%E5%BD%92%E5%87%BD%E6%95%B0%0A-%20%E5%A6%82%E6%9E%9C%E5%9C%A8%E4%B8%80%E4%B8%AA%E5%87%BD%E6%95%B0%E7%9A%84%E5%87%BD%E6%95%B0%E4%BD%93%E5%86%85%E8%B0%83%E7%94%A8%E4%BA%86%E8%AF%A5%E5%87%BD%E6%95%B0%E6%9C%AC%E8%BA%AB%EF%BC%8C%E8%BF%99%E4%B8%AA%E5%87%BD%E6%95%B0%E6%88%90%E4%B8%BA%E9%80%92%E5%BD%92%E5%87%BD%E6%95%B0%0A-%20%E9%80%92%E5%BD%92%E8%B0%83%E7%94%A8%E4%B8%8E%E9%80%92%E5%BD%92%E7%BB%88%E6%AD%A2%E6%9D%A1%E4%BB%B6%0A-%20%E6%AF%8F%E9%80%92%E5%BD%92%E8%B0%83%E7%94%A8%E4%B8%80%E6%AC%A1%E5%87%BD%E6%95%B0%EF%BC%8C%E9%83%BD%E4%BC%9A%E5%9C%A8%E6%A0%88%E5%86%85%E5%AD%98%E5%88%86%E9%85%8D%E4%B8%80%E4%B8%AA%E6%A0%88%E5%B8%A7%0A-%20%E6%AF%8F%E6%89%A7%E8%A1%8C%E5%AE%8C%E4%B8%80%E6%AC%A1%E5%87%BD%E6%95%B0%EF%BC%8C%E9%83%BD%E4%BC%9A%E9%87%8A%E6%94%BE%E5%93%8D%E5%BA%94%E7%9A%84%E7%A9%BA%E9%97%B4%0A-%20%E7%BC%BA%E7%82%B9%EF%BC%9A%E5%8D%A0%E7%94%A8%E5%86%85%E5%AD%98%E5%A4%9A%EF%BC%8C%E6%95%88%E7%8E%87%E4%BD%8E%E4%B8%8B%0A-%20%E6%9C%89%E7%82%B9%EF%BC%9A%E6%80%9D%E8%B7%AF%E5%92%8C%E4%BB%A3%E7%A0%81%E7%AE%80%E5%8D%95%0A%60%60%60python%0Adef%20fac(n)%3A%0A%20%20%20%20if%20n%3D%3D1%3A%0A%20%20%20%20%20%20%20%20return%201%0A%20%20%20%20else%3A%0A%20%20%20%20%20%20%20%20return%20n*fac(n-1)%0A%20%0A%20print(fac(6))%0A%60%60%60%0A%0A%23%23%20%E5%BC%82%E5%B8%B8%E5%A4%84%E7%90%86%0A%23%23%23%20try-except%20%E7%BB%93%E6%9E%84%0A%60%60%60python%0Atry%3A%0A%20%20%20%20a%3Dint(input('%E8%AF%B7%E8%BE%93%E5%85%A5%E7%AC%AC%E4%B8%80%E4%B8%AA%E6%95%B4%E6%95%B0%EF%BC%9A'))%0A%20%20%20%20b%3Dint(input('%E8%AF%B7%E8%BE%93%E5%85%A5%E7%AC%AC%E4%BA%8C%E4%B8%AA%E6%95%B4%E6%95%B0%EF%BC%9A'))%0A%20%20%20%20result%3Da%2Fb%0A%20%20%20%20print('%E7%BB%93%E6%9E%9C%E4%B8%BA%EF%BC%9A'%2Cresult)%0Aexcept%20ZeroDivisionError%3A%20%20%20%23%E6%8D%95%E8%8E%B7%E4%B8%BA%E9%9B%B6%E7%9A%84%E5%BC%82%E5%B8%B8%0A%20%20%20%20print('%E9%99%A4%E6%95%B0%E4%B8%8D%E5%85%81%E8%AE%B8%E4%B8%BA0')%0Aexcept%20ValueError%3A%20%20%23%E6%8D%95%E8%8E%B7%E5%80%BC%E7%B1%BB%E5%9E%8B%E5%BC%82%E5%B8%B8%0A%20%20%20%20print('%E8%AF%B7%E8%BE%93%E5%85%A5%E6%95%B0%E5%AD%97')%0Aexcept%20BaseException%20as%20e%3A%20%20%20%23%20%E6%9C%80%E5%90%8E%E5%86%99%E4%B8%8A%E8%BF%99%E4%B8%AA%E5%8F%AF%E4%BB%A5%E6%8D%95%E8%8E%B7%E9%81%97%E6%BC%8F%E7%9A%84%E3%80%81%E5%85%B6%E4%BB%96%E7%9A%84%E5%BC%82%E5%B8%B8%0A%20%20%20%20print('%E6%8D%95%E8%8E%B7%E5%85%B6%E4%BB%96%E5%BC%82%E5%B8%B8%E9%94%99%E8%AF%AF'%2Ce)%0Aprint('%E7%A8%8B%E5%BA%8F%E7%BB%93%E6%9D%9F')%0A%60%60%60%0A%0A%23%23%23%20try-except-else%20%E7%BB%93%E6%9E%84%0A%60%60%60python%0Atry%3A%0A%20%20%20%20a%3Dint(input('%E8%AF%B7%E8%BE%93%E5%85%A5%E7%AC%AC%E4%B8%80%E4%B8%AA%E6%95%B4%E6%95%B0%EF%BC%9A'))%0A%20%20%20%20b%3Dint(input('%E8%AF%B7%E8%BE%93%E5%85%A5%E7%AC%AC%E4%BA%8C%E4%B8%AA%E6%95%B4%E6%95%B0%EF%BC%9A'))%0A%20%20%20%20result%3Da%2Fb%0Aexcept%20ZeroDivisionError%3A%20%20%20%23%E6%8D%95%E8%8E%B7%E4%B8%BA%E9%9B%B6%E7%9A%84%E5%BC%82%E5%B8%B8%0A%20%20%20%20print('%E9%99%A4%E6%95%B0%E4%B8%8D%E5%85%81%E8%AE%B8%E4%B8%BA0')%0Aexcept%20ValueError%3A%20%20%23%E6%8D%95%E8%8E%B7%E5%80%BC%E7%B1%BB%E5%9E%8B%E5%BC%82%E5%B8%B8%0A%20%20%20%20print('%E8%AF%B7%E8%BE%93%E5%85%A5%E6%95%B0%E5%AD%97')%0Aexcept%20BaseException%20as%20e%3A%20%20%20%23%20%E6%9C%80%E5%90%8E%E5%86%99%E4%B8%8A%E8%BF%99%E4%B8%AA%E5%8F%AF%E4%BB%A5%E6%8D%95%E8%8E%B7%E9%81%97%E6%BC%8F%E7%9A%84%E3%80%81%E5%85%B6%E4%BB%96%E7%9A%84%E5%BC%82%E5%B8%B8%0A%20%20%20%20print('%E6%8D%95%E8%8E%B7%E5%85%B6%E4%BB%96%E5%BC%82%E5%B8%B8%E9%94%99%E8%AF%AF'%2Ce)%0Aelse%3A%0A%20%20%20%20print('%E7%BB%93%E6%9E%9C%E4%B8%BA%EF%BC%9A'%2Cresult)%0Aprint('%E7%A8%8B%E5%BA%8F%E7%BB%93%E6%9D%9F')%0A%60%60%60%0A%0A%23%23%23%20try-except-else-finally%20%E7%BB%93%E6%9E%84%0A!%5B911eebb3e28c2a582152970d6c9c721f.png%5D(en-resource%3A%2F%2Fdatabase%2F1306%3A1)%0A%60%60%60python%0Atry%3A%0A%20%20%20%20a%3Dint(input('%E8%AF%B7%E8%BE%93%E5%85%A5%E7%AC%AC%E4%B8%80%E4%B8%AA%E6%95%B4%E6%95%B0%EF%BC%9A'))%0A%20%20%20%20b%3Dint(input('%E8%AF%B7%E8%BE%93%E5%85%A5%E7%AC%AC%E4%BA%8C%E4%B8%AA%E6%95%B4%E6%95%B0%EF%BC%9A'))%0A%20%20%20%20result%3Da%2Fb%0Aexcept%20ZeroDivisionError%3A%20%20%20%23%E6%8D%95%E8%8E%B7%E4%B8%BA%E9%9B%B6%E7%9A%84%E5%BC%82%E5%B8%B8%0A%20%20%20%20print('%E9%99%A4%E6%95%B0%E4%B8%8D%E5%85%81%E8%AE%B8%E4%B8%BA0')%0Aexcept%20ValueError%3A%20%20%23%E6%8D%95%E8%8E%B7%E5%80%BC%E7%B1%BB%E5%9E%8B%E5%BC%82%E5%B8%B8%0A%20%20%20%20print('%E8%AF%B7%E8%BE%93%E5%85%A5%E6%95%B0%E5%AD%97')%0Aexcept%20BaseException%20as%20e%3A%20%20%20%23%20%E6%9C%80%E5%90%8E%E5%86%99%E4%B8%8A%E8%BF%99%E4%B8%AA%E5%8F%AF%E4%BB%A5%E6%8D%95%E8%8E%B7%E9%81%97%E6%BC%8F%E7%9A%84%E3%80%81%E5%85%B6%E4%BB%96%E7%9A%84%E5%BC%82%E5%B8%B8%0A%20%20%20%20print('%E6%8D%95%E8%8E%B7%E5%85%B6%E4%BB%96%E5%BC%82%E5%B8%B8%E9%94%99%E8%AF%AF'%2Ce)%0Aelse%3A%0A%20%20%20%20print('%E7%BB%93%E6%9E%9C%E4%B8%BA%EF%BC%9A'%2Cresult)%0Afinally%3A%0A%20%20%20%20print('%E7%A8%8B%E5%BA%8F%E7%BB%93%E6%9D%9F')%20%23%E6%97%A0%E8%AE%BA%20except%20%E8%BF%98%E6%98%AF%20else%20%E9%83%BD%E4%BC%9A%E6%89%A7%E8%A1%8C%E5%88%B0%E8%BF%99%E9%87%8C%0A%60%60%60%0A%0A%23%23%23%20Python%20%E5%B8%B8%E8%A7%81%E7%9A%84%E5%BC%82%E5%B8%B8%E7%B1%BB%E5%9E%8B%0A!%5Bf0607976958e605b16d0f1b03c2cbd0b.png%5D(en-resource%3A%2F%2Fdatabase%2F1307%3A1)%0A%0A%0A%23%23%23%20traceback%20%E6%A8%A1%E5%9D%97%E6%89%93%E5%8D%B0%E5%BC%82%E5%B8%B8%E4%BF%A1%E6%81%AF%0A-%20%E8%8E%B7%E5%8F%96%E5%BC%82%E5%B8%B8%E4%BF%A1%E6%81%AF%EF%BC%8C%E7%94%A8%E4%BA%8E%E5%90%8E%E7%BB%AD%E5%AF%B9%E5%BC%82%E5%B8%B8%E7%9A%84%E8%AE%B0%E5%BD%95log%E6%97%A5%E5%BF%97%E4%B9%8B%E7%B1%BB%E7%9A%84%E6%93%8D%E4%BD%9C%0A%20!%5Be1b48f6a9fd27421adad67e10aeaf9b4.png%5D(en-resource%3A%2F%2Fdatabase%2F1308%3A1)%0A%20%0A%23%23%20%E8%B0%83%E8%AF%95%0A-%20%20**%E6%96%AD%E7%82%B9**%0A-%20%E7%A8%8B%E5%BA%8F%E8%BF%90%E8%A1%8C%E5%88%B0%E6%AD%A4%E5%A4%84%EF%BC%8C%E6%9A%82%E6%97%B6%E6%8C%82%E8%B5%B7%EF%BC%8C%E5%81%9C%E6%AD%A2%E6%89%A7%E8%A1%8C%E3%80%82%E6%AD%A4%E4%BA%8B%E5%8F%AF%E4%BB%A5%E8%AF%A6%E7%BB%86%E8%A7%82%E5%AF%9F%E7%A8%8B%E5%BA%8F%E7%9A%84%E8%BF%90%E8%A1%8C%E6%83%85%E5%86%B5%EF%BC%8C%E6%96%B9%E4%BE%BF%E5%81%9A%E5%87%BA%E8%BF%9B%E4%B8%80%E6%AD%A5%E7%9A%84%E5%88%A4%E6%96%AD%0A-%20**%E8%BF%9B%E5%85%A5%E8%B0%83%E8%AF%95%E8%A7%86%E5%9B%BE**%0A-%20%E4%B8%89%E7%A7%8D%E6%96%B9%E5%BC%8F%EF%BC%9A%0A-%20%E5%8D%95%E5%87%BB%E5%B7%A5%E5%85%B7%E6%A0%8F%E7%9A%84%E6%8C%89%E9%92%AE%0A-%20%E5%8F%B3%E9%94%AE%E5%8D%95%E5%87%BB%E7%BC%96%E8%BE%91%E5%8C%BA%0A-%20%E5%BF%AB%E6%8D%B7%E9%94%AE%EF%BC%9Ashift%20%2B%20F9%0A-%20**%E4%BB%A5%E4%B8%8A%E5%86%85%E9%83%A8%E6%A0%B9%E6%8D%AE%E4%B8%8D%E5%90%8C%E7%9A%84%E7%BC%96%E8%AF%91%E5%99%A8%E5%8F%AF%E8%83%BD%E4%BC%9A%E4%B8%8D%E5%90%8C**%0A%0A%23%23%20%E7%BC%96%E7%A8%8B%E6%80%9D%E6%83%B3%0A-%20**%E7%BC%96%E7%A8%8B%E5%B1%8A%E7%9A%84%E4%B8%A4%E5%A4%A7%E9%98%B5%E8%90%A5**%0A!%5B99a282e4f3d3cdb9f7e78fd4d7c04300.png%5D(en-resource%3A%2F%2Fdatabase%2F1309%3A1)%0A%0A%23%23%20%E7%B1%BB%E4%B8%8E%E5%AF%B9%E8%B1%A1%0A%23%23%23%20%E7%B1%BB%0A-%20**%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B**%0A!%5Bfdc54dd3fee545a7e3a7c60c821a4574.png%5D(en-resource%3A%2F%2Fdatabase%2F1310%3A1)%0A%0A-%20**%E5%AF%B9%E8%B1%A1**%0A-%20100%E3%80%8199%E3%80%81520%20%E9%83%BD%E6%98%AF%20int%20%E7%B1%BB%E4%B9%8B%E4%B8%8B%E5%8C%85%E5%90%AB%E7%9A%84%E7%9B%B8%E4%BC%BC%E7%9A%84%E4%B8%8D%E5%90%8C%E4%B8%AA%E4%BE%8B%EF%BC%8C%E8%BF%99%E4%B8%AA%E4%B8%AA%E4%BE%8B%E4%B8%93%E4%B8%9A%E6%95%B0%E6%8D%AE%E7%A7%B0%E4%B8%BA%E5%AE%9E%E4%BE%8B%E6%88%96%E5%AF%B9%E8%B1%A1%0A-%20**%E4%B8%80%E5%88%87%E7%9A%86%E5%AF%B9%E8%B1%A1**%0A%0A%23%23%23%20%E5%88%9B%E5%BB%BA%E7%B1%BB%0A-%20%E7%B1%BB%E7%9A%84%E7%BB%84%E6%88%90%0A%20%20%20%201.%20%E5%B1%9E%E6%80%A7%0A%20%20%20%202.%20%E5%AE%9E%E4%BE%8B%E6%96%B9%E6%B3%95%20self%0A%20%20%20%203.%20%E9%9D%99%E6%80%81%E6%96%B9%E6%B3%95%0A%20%20%20%204.%20%E7%B1%BB%E6%96%B9%E6%B3%95%20cls%0A%0A%60%60%60python%0Aclass%20Student%3A%20%20%23%E7%B1%BB%0A%20%20%20%20native_pace%3D'%E5%B9%BF%E5%B7%9E'%20%23%E5%86%99%E5%9C%A8%E7%B1%BB%E9%87%8C%E7%9A%84%E5%8F%98%E9%87%8F%EF%BC%8C%E7%A7%B0%E4%B8%BA%E7%B1%BB%E5%B1%9E%E6%80%A7%0A%20%20%20%20%0A%20%20%20%20%23%E5%88%9D%E5%A7%8B%E5%8C%96%E6%96%B9%E6%B3%95%0A%20%20%20%20def%20__init__(self%2Cname%2Cage)%3A%0A%20%20%20%20%20%20%20%20self.name%3Dname%20%20%23self.name%20%E7%A7%B0%E4%B8%BA%E5%AE%9E%E4%BD%93%E5%B1%9E%E6%80%A7%EF%BC%8C%E8%BF%9B%E8%A1%8C%E4%BA%86%E4%B8%80%E4%B8%AA%E5%A4%8D%E5%88%B6%E7%9A%84%E6%93%8D%E4%BD%9C%EF%BC%8C%E5%B0%86%E5%B1%80%E9%83%A8%E5%8F%98%E9%87%8F%E7%9A%84%20name%20%E7%9A%84%E5%80%BC%E8%B5%8B%E7%BB%99%E5%AE%9E%E4%BD%93%E5%B1%9E%E6%80%A7%0A%20%20%20%20%20%20%20%20self.age%3Dage%0A%20%20%20%20%0A%20%20%20%20%23%E5%AE%9E%E4%BE%8B%E6%96%B9%E6%B3%95%0A%20%20%20%20def%20eat(self)%3A%20%20%23%E5%AE%9E%E4%BE%8B%E6%96%B9%E6%B3%95%E7%9A%84%E5%8F%82%E6%95%B0%E4%B8%AD%EF%BC%8C%E5%BF%85%E9%A1%BB%E5%86%99%E4%B8%8A%20self%20%EF%BC%8C%E5%93%AA%E6%80%95%E4%B8%8D%E5%86%99%E5%AE%83%E4%B9%9F%E4%BC%9A%E9%BB%98%E8%AE%A4%0A%20%20%20%20%20%20%20%20print('%E5%AD%A6%E7%94%9F%E5%9C%A8%E5%90%83%E9%A5%AD%E3%80%82')%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%23%E9%9D%99%E6%80%81%E6%96%B9%E6%B3%95%0A%20%20%20%20%40staticmethod%0A%20%20%20%20def%20method()%3A%20%20%20%23%E9%9D%99%E6%80%81%E6%96%B9%E6%B3%95%E7%9A%84%E5%8F%82%E6%95%B0%E4%B8%8D%E5%85%81%E8%AE%B8%E5%86%99%20self%20%EF%BC%8C%E8%BF%99%E6%98%AF%E8%A7%84%E5%AE%9A%0A%20%20%20%20%20%20%20%20print('%E6%88%91%E4%BD%BF%E7%94%A8%E4%BA%86%20staticmethod%20%E8%BF%9B%E8%A1%8C%E4%BA%86%E4%BF%AE%E9%A5%B0%EF%BC%8C%E6%89%80%E4%BB%A5%E6%88%91%E6%98%AF%E9%9D%99%E6%80%81%E6%96%B9%E6%B3%95')%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20%23%E7%B1%BB%E6%96%B9%E6%B3%95%0A%20%20%20%20%40classmethod%0A%20%20%20%20def%20cm(cls)%3A%20%23%E7%B1%BB%E6%96%B9%E6%B3%95%E6%8B%AC%E5%8F%B7%E4%B8%AD%E5%BF%85%E9%A1%BB%E5%B8%A6%20cls%20%EF%BC%8C%E8%BF%99%E6%98%AF%E8%A7%84%E5%AE%9A%0A%20%20%20%20%20%20%20%20print('%E6%88%91%E6%98%AF%E7%B1%BB%E6%96%B9%E6%B3%95%EF%BC%8C%E5%9B%A0%E4%B8%BA%E6%88%91%E4%BD%BF%E7%94%A8%E4%BA%86%20classmethod%20%E8%BF%9B%E8%A1%8C%E4%BF%AE%E9%A5%B0')%0A%60%60%60%0A-%20**%E5%9C%A8%E7%B1%BB%E5%A4%96%E9%9D%A2%E5%AE%9A%E4%B9%89%E7%9A%84%E7%A7%B0%E4%B9%8B%E4%B8%BA%E5%87%BD%E6%95%B0%EF%BC%8C%E5%9C%A8%E7%B1%BB%E5%AE%9A%E4%B9%89%E7%9A%84%E7%A7%B0%E4%B8%BA%E6%96%B9%E6%B3%95**%0A%0A%23%23%23%20%E7%B1%BB%E7%9A%84%E5%AE%9E%E4%BE%8B%E5%8C%96%0A-%20%E6%84%8F%E4%B9%89%EF%BC%9A%E6%9C%89%E4%BA%86%E5%AE%9E%E4%BE%8B%EF%BC%8C%E5%B0%B1%E5%8F%AF%E4%BB%A5%E8%B0%83%E7%94%A8%E7%B1%BB%E4%B8%AD%E7%9A%84%E5%86%85%E5%AE%B9%0A%60%60%60python%0A%23%E5%88%9B%E5%BB%BA%20Student%20%E7%B1%BB%E7%9A%84%E5%AE%9E%E4%BE%8B%E5%AF%B9%E8%B1%A1%20stul%0Astul%3DStudent('%E5%BC%A0%E4%B8%89'%2C20)%0Astul.eat()%20%23%E4%BD%BF%E7%94%A8%E7%B1%BB%E7%9A%84%E6%96%B9%E6%B3%95%0Aprint(stul.name%2Cstul.age)%20%23%E8%8E%B7%E5%8F%96%E7%B1%BB%E7%9A%84%E5%B1%9E%E6%80%A7%0A%23%E7%AC%AC%E4%BA%8C%E7%A7%8D%E8%B0%83%E7%94%A8%E6%96%B9%E6%B3%95%EF%BC%9A%E7%B1%BB%E5%90%8D.%E6%96%B9%E6%B3%95%E5%90%8D(%E7%B1%BB%E7%9A%84%E5%AE%9E%E4%BE%8B%E5%AF%B9%E8%B1%A1)%EF%BC%8C%E5%AE%9E%E9%99%85%E4%B8%8A%E5%B0%B1%E6%98%AF%E6%96%B9%E6%B3%95%E5%AE%9A%E4%B9%89%E5%A4%84%E7%9A%84self%0AStudent.eat(stul)%20%23%E8%AF%A5%E4%BB%A3%E7%A0%81%E5%86%99%E6%B3%95%E7%9A%84%E5%8A%9F%E8%83%BD%EF%BC%8C%E4%B8%8E%20stul.eat()%20%E6%96%B9%E6%B3%95%E7%9A%84%E5%8A%9F%E8%83%BD%E4%B8%80%E8%87%B4%0A%60%60%60%0A%23%23%23%20%E7%B1%BB%E5%B1%9E%E6%80%A7%0A-%20%E7%B1%BB%E4%B8%AD%E6%96%B9%E6%B3%95%E5%A4%96%E7%9A%84%E5%8F%98%E9%87%8F%E7%A7%B0%E4%B8%BA%E7%B1%BB%E5%B1%9E%E6%80%A7%EF%BC%8C%E8%A2%AB%E8%AF%A5%E7%B1%BB%E7%9A%84%E6%89%80%E6%9C%89%E5%AF%B9%E8%B1%A1%E6%89%80%E5%85%B1%E4%BA%AB%0A%60%60%60python%0Aprint(Student.native_pace)%0Astul%3DStudent('%E5%BC%A0%E4%B8%89'%2C20)%0Astu2%3DStudent('%E6%9D%8E%E5%9B%9B'%2C30)%0A%23%E4%BF%AE%E6%94%B9%E7%B1%BB%E7%9A%84%E5%B1%9E%E6%80%A7%E5%80%BC%0AStudent.native_pace%3D'%E5%A4%A9%E6%B4%A5'%0Aprint(stul.native_pase)%20%23%E8%BF%94%E5%9B%9E%20%E5%A4%A9%E6%B4%A5%0Aprint(stu2.native_pase)%20%23%E8%BF%94%E5%9B%9E%20%E5%A4%A9%E6%B4%A5%0A%0A%23%E7%B1%BB%E5%B1%9E%E6%80%A7%E5%85%B1%E4%BA%AB%EF%BC%8C%E4%BE%9B%E5%A4%9A%E4%B8%AA%E5%AE%9E%E4%BE%8B%E5%8C%96%E8%AE%BF%E9%97%AE%E7%9B%B8%E5%90%8C%E7%9A%84%E5%86%85%E5%AD%98%E5%9C%B0%E5%9D%80%0A%60%60%60%0A%0A%23%23%23%20%E7%B1%BB%E6%96%B9%E6%B3%95%0A-%20%E4%BD%BF%E7%94%A8%20%40classmethod%20%E4%BF%AE%E9%A5%B0%E7%9A%84%E6%96%B9%E6%B3%95%EF%BC%8C%E4%BD%BF%E7%94%A8%E9%9B%B7%E9%B8%A3%E7%9B%B4%E6%8E%A5%E8%AE%BF%E9%97%AE%E7%9A%84%E6%96%B9%E6%B3%95%0A%60%60%60python%0AStudent.cm()%0A%60%60%60%0A%0A%23%23%23%20%E9%9D%99%E6%80%81%E6%96%B9%E6%B3%95%0A-%20%E4%BD%BF%E7%94%A8%20%40staticmethod%20%E4%BF%AE%E9%A5%B0%E7%9A%84%E6%96%B9%E6%B3%95%EF%BC%8C%E4%BD%BF%E7%94%A8%E7%B1%BB%E5%90%8D%E7%9B%B4%E6%8E%A5%E8%AE%BF%E9%97%AE%E7%9A%84%E6%96%B9%E6%B3%95%0A%60%60%60python%0AStudent.method()%0A%60%60%60%0A%0A%23%23%23%20%E5%8A%A8%E6%80%81%E7%BB%91%E5%AE%9A%E5%B1%9E%E6%80%A7%E5%92%8C%E6%96%B9%E6%B3%95%0A-%20Python%20%E6%98%AF%E5%8A%A8%E6%80%81%E8%AF%AD%E8%A8%80%EF%BC%8C%E5%9C%A8%E5%88%9B%E5%BB%BA%E5%AF%B9%E8%B1%A1%E5%90%8E%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%8A%A8%E6%80%81%E7%BB%91%E5%AE%9A%E5%B1%9E%E6%80%A7%E5%92%8C%E6%96%B9%E6%B3%95%0A%60%60%60python%0Aclass%20Student%3A%0A%20%20%20%20def%20__init__(self%2Cname%2Cage)%3A%0A%20%20%20%20%20%20%20%20self.name%3Dname%0A%20%20%20%20%20%20%20%20self.age%3Dage%0A%20%20%20%20%20%20%20%20%0A%20%20%20%20def%20eat(self)%3A%0A%20%20%20%20%20%20%20%20print(self.name%2B'%E5%9C%A8%E5%90%83%E9%A5%AD%E3%80%82')%0A%0Astu1%3DStudent('%E5%BC%A0%E4%B8%89'%2C20)%0Astu2%3DStudent('%E6%9D%8E%E5%9B%9B'%2C30)%0A%60%60%60%0A!%5B0b2fb01bed5b935c2d9700877ad8369a.png%5D(en-resource%3A%2F%2Fdatabase%2F1311%3A1)%0A%60%60%60python%0A%23%E4%B8%BA%E5%AE%9E%E4%BE%8B%E5%AF%B9%E8%B1%A1%20%E5%8A%A8%E6%80%81%E5%88%9B%E5%BB%BA%E5%B1%9E%E6%80%A7%0Astu2.gender%3D'%E5%A5%B3'%20%23%E8%AF%A5%E5%B1%9E%E6%80%A7%E5%80%BC%E9%9A%B6%E5%B1%9E%E4%BA%8E%E5%AE%9E%E4%BE%8B%E5%AF%B9%E8%B1%A1%20stu2%20%E7%9A%84%0Aprint(stu1.name%2Cstu1.age)%20%23%E8%BE%93%E5%87%BA%20%E5%BC%A0%E4%B8%89%20%2020%0Aprint(stu2.name%2Cstu2.age%2Cstu2.gender)%20%23%E8%BE%93%E5%87%BA%20%E6%9D%8E%E5%9B%9B%20%2030%20%20%E5%A5%B3%0A%60%60%60%0A-%20**%E5%8A%A8%E6%80%81%E7%BB%91%E5%AE%9A%E6%96%B9%E6%B3%95**%0A%60%60%60python%0A%23%E7%B1%BB%E4%B9%8B%E5%A4%96%E5%88%9B%E5%BB%BA%E4%B8%80%E4%B8%AA%E5%87%BD%E6%95%B0%0Adef%20show()%3A%0A%20%20%20%20print('%E5%AE%9A%E4%B9%89%E5%9C%A8%E7%B1%BB%E4%B9%8B%E5%A4%96%E7%9A%84%EF%BC%8C%E7%A7%B0%E5%87%BD%E6%95%B0')%0A%23%E7%BB%91%E5%AE%9A%E5%88%B0%E5%AE%9E%E4%BE%8B%E5%AF%B9%E8%B1%A1%20stu1%20%E7%9A%84%20show%20%E6%96%B9%E6%B3%95%0Astu1.show%3Dshow%0Astu1.show()%0A%60%60%60%0A%0A%23%23%23%20%E5%B0%81%E8%A3%85%0A%3E%20**%E6%8F%90%E9%AB%98%E7%A8%8B%E5%BA%8F%E7%9A%84%E5%AE%89%E5%85%A8%E6%80%A7**%0A%3E%20-%20%E5%B0%86%E6%95%B0%E6%8D%AE%EF%BC%88%E5%B1%9E%E6%80%A7%EF%BC%89%E5%92%8C%E8%A1%8C%E4%B8%BA%EF%BC%88%E6%96%B9%E6%B3%95%EF%BC%89%E5%8C%85%E8%A3%85%E5%88%B0%E7%B1%BB%E5%AF%B9%E8%B1%A1%E4%B8%AD%E3%80%82%E5%9C%A8%E6%96%B9%E6%B3%95%E5%86%85%E9%83%A8%E5%AF%B9%E5%B1%9E%E6%80%A7%E8%BF%9B%E8%A1%8C%E6%93%8D%E4%BD%9C%EF%BC%8C%E5%9C%A8%E7%B1%BB%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%A4%96%E9%83%A8%E8%B0%83%E7%94%A8%E6%96%B9%E6%B3%95%E3%80%82%E8%BF%99%E6%A0%B7%EF%BC%8C%E6%97%A0%E5%BA%8F%E5%85%B3%E5%BF%83%E6%96%B9%E6%B3%95%E5%86%85%E9%83%A8%E7%9A%84%E5%85%B7%E4%BD%93%E5%AE%9E%E7%8E%B0%E7%BB%86%E8%8A%82%EF%BC%8C%E4%BB%8E%E8%80%8C%E9%9A%94%E7%A6%BB%E4%BA%86%E5%A4%8D%E6%9D%82%E5%BA%A6%E3%80%82%0A%3E%20-%20%E5%9C%A8%20Python%20%E4%B8%AD%E6%B2%A1%E6%9C%89%E4%B8%93%E9%97%A8%E7%9A%84%E4%BF%AE%E9%A5%B0%E7%AC%A6%E7%94%A8%E4%BA%8E%E5%B1%9E%E6%80%A7%E7%9A%84%E7%A7%81%E6%9C%89%EF%BC%8C%E5%A6%82%E6%9E%9C%E8%AF%A5%E5%B1%9E%E6%80%A7%E4%B8%8D%E5%B8%8C%E6%9C%9B%E5%9C%A8%E7%B1%BB%E5%AF%B9%E8%B1%A1%E5%A4%96%E8%A2%AB%E8%AE%BF%E9%97%AE%EF%BC%8C%E5%89%8D%E9%9D%A2%E4%BD%BF%E7%94%A8%E4%B8%A4%E4%B8%AA%E2%80%9C_%E2%80%9D%0A%0A%60%60%60python%0A%23%E5%88%9B%E5%BB%BA%E7%B1%BB%0Aclass%20Car%3A%0A%20%20%20%20def%20__init__(self%2Cbrand)%3A%0A%20%20%20%20%20%20%20%20self.brand%3Dbrand%0A%20%20%20%20def%20start(self)%3A%0A%20%20%20%20%20%20%20%20print('%E6%B1%BD%E8%BD%A6%E5%B7%B2%E5%90%AF%E5%8A%A8%E3%80%82%E3%80%82%E3%80%82')%0A%0A%23%E5%AE%9E%E4%BE%8B%E5%8C%96%E7%B1%BB%0Acar%3DCar('%E5%AE%9D%E9%A9%ACX5')%0A%0A%23%E4%BD%BF%E7%94%A8%E7%B1%BB%E7%9A%84%E6%96%B9%E6%B3%95%0Acar.start()%0A%0A%23%E4%BD%BF%E7%94%A8%E7%B1%BB%E7%9A%84%E5%B1%9E%E6%80%A7%0Aprint(car.brand)%0A%0Aclass%20Student%3A%0A%20%20%20%20def%20__init__(self%2Cname%2Cage)%3A%0A%20%20%20%20%20%20%20%20self.name%3Dname%0A%20%20%20%20%20%20%20%20self.__age%3Dage%20%20%23%E5%B9%B4%E9%BE%84%E4%B8%8D%E5%B8%8C%E6%9C%9B%E5%9C%A8%E7%B1%BB%E7%9A%84%E5%A4%96%E9%83%A8%E8%A2%AB%E4%BD%BF%E7%94%A8%EF%BC%8C%E4%BD%BF%E7%94%A8%E5%8A%A0%E4%BA%86%E4%B8%A4%E4%B8%AA%22_%22%0A%20%20%20def%20show(self)%3A%0A%20%20%20%20print(self.name%2Cself.__age)%0A%0Astu%3DStudent('%E5%BC%A0%E4%B8%89'%2C20)%0Astu.show()%20%23%E8%BE%93%E5%87%BA%20%20%E5%BC%A0%E4%B8%89%20%20%2020%0A%0Aprint(stu.name)%20%23%E8%BE%93%E5%87%BA%20%E5%BC%A0%E4%B8%89%0Aprint(stu.__age)%20%23%E7%A8%8B%E5%BA%8F%E6%8A%9B%E9%94%99%EF%BC%8C%E6%8F%90%E7%A4%BA%E5%B1%9E%E6%80%A7%E9%94%99%E8%AF%AF%EF%BC%8C%E8%AF%A5%E5%B1%9E%E6%80%A7%E4%B8%BA%E7%B1%BB%E7%9A%84%E7%A7%81%E6%9C%89%E5%B1%9E%E6%80%A7%EF%BC%8C%E5%A4%96%E9%83%A8%E4%B8%8D%E5%85%81%E8%AE%B8%E4%BD%BF%E7%94%A8%0A%0Aprint(stu._Student__age)%20%23%E5%9C%A8%E7%B1%BB%E7%9A%84%E5%A4%96%E9%83%A8%E5%8F%AF%E4%BB%A5%E9%80%9A%E8%BF%87%20_Student__age%20%E8%BF%9B%E8%A1%8C%E8%AE%BF%E9%97%AE%0A%60%60%60%0A-%20**%E6%8F%90%E7%A4%BA%EF%BC%9A%E4%BD%9C%E4%B8%BA%E7%A8%8B%E5%BA%8F%E5%91%98%EF%BC%8C%E5%BC%BA%E7%83%88%E5%BB%BA%E8%AE%AE%E4%B8%8D%E9%87%87%E5%8F%96%E8%BF%99%E7%A7%8D%E6%96%B9%E5%BC%8F%E8%AE%BF%E9%97%AE%20%20_Student__age**%0A%0A%23%23%23%20%E7%BB%A7%E6%89%BF%0A-%20**%E6%8F%90%E9%AB%98%E4%BB%A3%E7%A0%81%E7%9A%84%E5%A4%8D%E7%94%A8%E6%80%A7**%0A-%20%E8%AF%AD%E6%B3%95%E6%A0%BC%E5%BC%8F%0A-%20class%20%E5%AD%90%E7%B1%BB%E7%B1%BB%E5%90%8D(%20%E7%88%B6%E7%B1%BB1%20%2C%20%E7%88%B6%E7%B1%BB2...%20)%0A-%20%20%20%20%20pass%0A-%20**%E5%A6%82%E6%9E%9C%E4%B8%80%E4%B8%AA%E7%B1%BB%E6%B2%A1%E6%9C%89%E7%BB%A7%E6%89%BF%E4%BB%BB%E4%BD%95%E5%9F%BA%E7%B1%BB%EF%BC%8C%E5%88%99%E9%BB%98%E8%AE%A4%E7%BB%A7%E6%89%BF%20object**%0A-%20**Python%E6%94%AF%E6%8C%81%E5%A4%9A%E7%BB%A7%E6%89%BF**%0A-%20**%E5%AE%9A%E4%B9%89%E5%AD%90%E7%B1%BB%E6%97%B6%EF%BC%8C%E5%BF%85%E9%A1%BB%E5%9C%A8%E5%85%B6%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0%E4%B8%AD%E8%B0%83%E7%94%A8%E7%88%B6%E7%B1%BB%E7%9A%84%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0**%0A!%5B60f2eecc303b7942c743dd72cd593c3b.png%5D(en-resource%3A%2F%2Fdatabase%2F1312%3A1)%0A%60%60%60python%0A%23%E5%A4%9A%E7%BB%A7%E6%89%BF%0Aclass%20A(object)%3A%0A%20%20%20%20pass%0A%0Aclass%20B(object)%3A%0A%20%20%20%20pass%0A%0A%23C%E7%B1%BB%E7%BB%A7%E6%89%BF%E4%BA%86A%E3%80%81B%E4%B8%A4%E4%B8%AA%E7%B1%BB%0Aclass%20C(A%2CB)%3A%0A%20%20%20%20pass%0A%60%60%60%0A%0A%23%23%23%20%E6%96%B9%E6%B3%95%E9%87%8D%E5%86%99%0A-%20%E5%A6%82%E6%9E%9C%E5%AD%90%E7%B1%BB%E5%AF%B9%E7%BB%A7%E6%89%BF%E8%87%AA%E7%88%B6%E7%B1%BB%E7%9A%84%E6%9F%90%E4%B8%AA%E5%B1%9E%E6%80%A7%E6%88%96%E6%96%B9%E6%B3%95%E4%B8%8D%E6%BB%A1%E6%84%8F%EF%BC%8C%E5%8F%AF%E4%BB%A5%E5%9C%A8%E5%AD%90%E7%B1%BB%E4%B8%AD%E5%AF%B9%E5%85%B6%EF%BC%88%E6%96%B9%E6%B3%95%E4%BD%93%EF%BC%89%E8%BF%9B%E8%A1%8C%E9%87%8D%E6%96%B0%E7%BC%96%E5%86%99%0A-%20%E5%AD%90%E7%B1%BB%E9%87%8D%E5%86%99%E5%90%8E%E7%9A%84%E6%96%B9%E6%B3%95%E4%B8%AD%E5%8F%AF%E4%BB%A5%E9%80%9A%E8%BF%87%20super().xxx()%20%E8%B0%83%E7%94%A8%E7%88%B6%E7%B1%BB%E4%B8%AD%E8%A2%AB%E9%87%8D%E5%86%99%E7%9A%84%E6%96%B9%E6%B3%95%0A!%5B88df605d3538569009210c19be1a028a.png%5D(en-resource%3A%2F%2Fdatabase%2F1313%3A1)%0A%0A%23%23%23%20object%E7%B1%BB%0A-%20object%20%E7%B1%BB%E6%98%AF%E6%89%80%E6%9C%89%E7%B1%BB%E7%9A%84%E7%88%B6%E7%B1%BB%EF%BC%8C%E6%89%80%E6%9C%89%E7%B1%BB%E9%83%BD%E6%9C%89%20object%20%E7%B1%BB%E7%9A%84%E5%B1%9E%E6%80%A7%E5%92%8C%E6%96%B9%E6%B3%95%0A-%20%E5%86%85%E7%BD%AE%E5%87%BD%E6%95%B0%20dir()%20%E5%8F%AF%E4%BB%A5%E6%9F%A5%E7%9C%8B%E6%8C%87%E5%AE%9A%E5%AF%B9%E8%B1%A1%E6%89%80%E6%9C%89%E5%B1%9E%E6%80%A7%0A-%20**Object%20%E6%9C%89%E4%B8%80%E4%B8%AA%20__str__()%20%E6%96%B9%E6%B3%95%EF%BC%8C%E7%94%A8%E4%BA%8E%E8%BF%94%E5%9B%9E%E4%B8%80%E4%B8%AA%E5%AF%B9%E4%BA%8E%E2%80%9C%E5%AF%B9%E8%B1%A1%E7%9A%84%E6%8F%8F%E8%BF%B0%E2%80%9D%EF%BC%8C%E5%AF%B9%E5%BA%94%E4%BA%8E%E5%86%85%E7%BD%AE%E5%87%BD%E6%95%B0%20str()%20%E7%BB%8F%E5%B8%B8%E7%94%A8%E4%BA%8E%20print()%20%E6%96%B9%E6%B3%95%EF%BC%8C%E5%B8%AE%E6%88%91%E4%BB%AC%E6%9F%A5%E7%9C%8B%E5%AF%B9%E8%B1%A1%E7%9A%84%E4%BF%A1%E6%81%AF%EF%BC%8C%E6%89%80%E6%9C%89%E6%88%91%E4%BB%AC%E7%BB%8F%E5%B8%B8%E4%BC%9A%E5%AF%B9%20__str__()%20%E8%BF%9B%E8%A1%8C%E9%87%8D%E5%86%99**%0A!%5B8a0d481dcdb6f0109e255affe3b7da4e.png%5D(en-resource%3A%2F%2Fdatabase%2F1314%3A1)%0A%0A%23%23%23%20%E5%A4%9A%E5%A4%AA%0A%3E%20**%E6%8F%90%E9%AB%98%E7%A8%8B%E5%BA%8F%E7%9A%84%E5%8F%AF%E6%89%A9%E5%B1%95%E6%80%A7%E5%92%8C%E5%8F%AF%E7%BB%B4%E6%8A%A4%E6%80%A7**%0A-%20%E5%8D%B3%E4%BE%BF%E4%B8%8D%E7%9F%A5%E9%81%93%E4%B8%80%E4%B8%AA%E5%8F%98%E9%87%8F%E6%89%80%E5%BC%95%E7%94%A8%E7%9A%84%E5%AF%B9%E8%B1%A1%E5%88%B0%E5%BA%95%E6%98%AF%E4%BB%80%E4%B9%88%E7%B1%BB%E5%9E%8B%EF%BC%8C%E4%BB%8D%E7%84%B6%E5%8F%AF%E4%BB%A5%E9%80%9A%E8%BF%87%E8%BF%99%E4%B8%AA%E5%8F%98%E9%87%8F%E8%B0%83%E7%94%A8%E6%96%B9%E6%B3%95%EF%BC%8C%E5%9C%A8%E8%BF%90%E8%A1%8C%E8%BF%87%E7%A8%8B%E4%B8%AD%E6%A0%B9%E6%8D%AE%E5%8F%98%E9%87%8F%E6%89%80%E5%BC%95%E7%94%A8%E5%AF%B9%E8%B1%A1%E7%9A%84%E7%B1%BB%E5%9E%8B%EF%BC%8C%E5%8A%A8%E6%80%81%E5%86%B3%E5%AE%9A%E8%B0%83%E7%94%A8%E5%93%AA%E4%B8%AA%E5%AF%B9%E8%B1%A1%E4%B8%AD%E7%9A%84%E6%96%B9%E6%B3%95%0A!%5Ba27f933c9f7d8105b0db0984222d53c4.png%5D(en-resource%3A%2F%2Fdatabase%2F1315%3A1)%0A%0A%23%23%23%20%E7%89%B9%E6%AE%8A%E6%96%B9%E6%B3%95%E5%92%8C%E7%89%B9%E6%AE%8A%E5%B1%9E%E6%80%A7%0A!%5Bf9ad52e3c08ad448122a598c685ab261.png%5D(en-resource%3A%2F%2Fdatabase%2F1316%3A1)%0A%0A%23%23%23%20%E5%8F%98%E9%87%8F%E8%B5%8B%E5%80%BC%E6%93%8D%E4%BD%9C%0A-%20%E5%8F%AA%E6%98%AF%E5%BD%A2%E6%88%90%E4%B8%A4%E4%B8%AA%E5%8F%98%E9%87%8F%EF%BC%8C%E5%AE%9E%E9%99%85%E4%B8%8A%E8%BF%98%E6%98%AF%E6%8C%87%E5%90%91%E5%90%8C%E4%B8%80%E4%B8%AA%E5%AF%B9%E8%B1%A1%0A%60%60%60python%0Aclass%20CPU%3A%0A%20%20%20%20pass%0A%0Aclass%20Disk%3A%0A%20%20%20%20pass%0A%0Aclass%20Computer%3A%0A%20%20%20%20def%20__init__(self%2Ccpu%2Cdisk)%3A%0A%20%20%20%20%20%20%20%20self.cpu%3Dcpu%0A%20%20%20%20%20%20%20%20self.disk%3Ddisk%0A%0A%23%E5%AE%9E%E4%BE%8BCPU%E7%9A%84%E7%B1%BB%E5%AE%9E%E4%BE%8B%0Acpu1%3DCPU()%0A%0A%23%E5%B0%86%E5%AE%9E%E4%BE%8B%E5%AF%B9%E8%B1%A1%20cpu1%20%E8%B5%8B%E5%80%BC%E7%BB%99%20cpu2%0Acpu2%3Dcpu1%0A%0A%23%E8%BE%93%E5%87%BA%E4%B8%A4%E4%B8%AA%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%86%85%E5%AD%98%E5%9C%B0%E5%9D%80%E6%98%AF%E4%B8%80%E6%A0%B7%E7%9A%84%0Aprint(cpu1%2Ccpu2)%0A%0A%23%E6%80%BB%E7%BB%93%EF%BC%8C%E5%8F%98%E9%87%8F%E8%B5%8B%E5%80%BC%EF%BC%8C%E5%AE%9E%E9%99%85%E4%B8%8A%E8%BF%98%E6%98%AF%E6%8C%87%E5%90%91%E5%90%8C%E4%B8%80%E4%B8%AA%E5%AF%B9%E8%B1%A1%0A%60%60%60%0A%0A%23%23%23%20%E6%B5%85%E6%8B%B7%E8%B4%9D%0A-%20Python%20%E6%8B%B7%E8%B4%9D%E4%B8%80%E7%89%88%E9%83%BD%E6%98%AF%E6%B5%85%E6%8B%B7%E8%B4%9D%EF%BC%8C%E6%8B%B7%E8%B4%9D%E6%97%B6%EF%BC%8C%E5%AF%B9%E8%B1%A1%E5%8C%85%E5%90%AB%E7%9A%84%E5%AD%90%E5%AF%B9%E8%B1%A1%E4%B8%8D%E6%8B%B7%E8%B4%9D%EF%BC%8C%E5%9B%A0%E6%AD%A4%EF%BC%8C%E6%BA%90%E5%AF%B9%E8%B1%A1%E4%B8%8E%E6%8B%B7%E8%B4%9D%E5%AF%B9%E8%B1%A1%E4%BC%9A%E5%BC%95%E7%94%A8%E5%90%8C%E4%B8%80%E4%B8%AA%E5%AD%90%E5%AF%B9%E8%B1%A1%0A%60%60%60python%0Aclass%20CPU%3A%0A%20%20%20%20pass%0A%0Aclass%20Disk%3A%0A%20%20%20%20pass%0A%0Aclass%20Computer%3A%0A%20%20%20%20def%20__init__(self%2Ccpu%2Cdisk)%3A%0A%20%20%20%20%20%20%20%20self.cpu%3Dcpu%0A%20%20%20%20%20%20%20%20self.disk%3Ddisk%0A%20%0A%20cpu1%3DCPU()%0A%20disk1%3DDisk()%0A%20computer1%3DComputer(cup1%2Cdisk1)%20%23%E5%88%9B%E5%BB%BA%E8%AE%A1%E7%AE%97%E6%9C%BA%E7%9A%84%E5%AE%9E%E4%BE%8B%E5%AF%B9%E8%B1%A1%0A%20%0A%20%23%E6%B5%85%E6%8B%B7%E8%B4%9D%0A%20import%20copy%0A%20computer2%3Dcopy.copy(computer1)%0A%20%0A%20%23%E8%BE%93%E5%87%BA%E7%B1%BB%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%86%85%E5%AD%98%E5%9C%B0%E5%9D%80%EF%BC%8C%E5%8F%8A%E5%AD%90%E7%B1%BB%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%9C%B0%E5%9D%80%0A%20print(computer1%2Ccomputer1.cpu%2Ccomputer1.disk)%0A%20print(computer2%2Ccomputer2.cpu%2Ccomputer2.disk)%0A%0A%23%20%E7%BB%93%E8%AE%BA%EF%BC%9Acomputer%E7%B1%BB%E7%9A%84%E4%B8%A4%E4%B8%AA%E5%AE%9E%E4%BE%8B%E5%8C%96%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%86%85%E5%AD%98%E5%9C%B0%E5%9D%80%E4%B8%8D%E5%90%8C%EF%BC%8C%E4%BD%86%E4%B8%A4%E4%B8%AA%20cpu%20%E5%92%8C%20disk%20%E5%AD%90%E7%B1%BB%E5%AE%9E%E4%BE%8B%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%86%85%E5%AD%98%E5%9C%B0%E5%9D%80%E4%B8%80%E6%A0%B7%0A%60%60%60%0A%0A%23%23%23%20%E6%B7%B1%E6%8B%B7%E8%B4%9D%0A-%20%E4%BD%BF%E7%94%A8%20copy%20%E6%A8%A1%E5%9D%97%E7%9A%84%20**deepcopy**%20%E5%87%BD%E6%95%B0%EF%BC%8C%E9%80%92%E5%BD%92%E6%8B%B7%E8%B4%9D%E5%AF%B9%E8%B1%A1%E4%B8%AD%E7%9A%84%E5%AD%90%E5%AF%B9%E8%B1%A1%EF%BC%8C%E6%BA%90%E5%AF%B9%E8%B1%A1%E5%92%8C%E6%8B%B7%E8%B4%9D%E5%AF%B9%E8%B1%A1%E6%89%80%E6%9C%89%E7%9A%84%E5%AD%90%E5%AF%B9%E8%B1%A1%E4%B9%9F%E4%B8%8D%E7%9B%B8%E5%90%8C%0A%60%60%60python%0A%23%E6%B7%B1%E6%8B%B7%E8%B4%9D%0Acomputer3%3Dcopy.deepcopy(computre1)%0Aprint(computer1%2Ccomputer1.cpu%2Ccomputer1.disk)%0Aprint(computer2%2Ccomputer2.cpu%2Ccomputer2.disk)%0A%23%20%E7%BB%93%E8%AE%BA%EF%BC%9Acomputer%E7%B1%BB%E4%B8%8E%E4%B8%A4%E4%B8%AA%20cpu%20%E5%92%8C%20disk%20%E5%AD%90%E7%B1%BB%E5%AE%9E%E4%BE%8B%E5%AF%B9%E8%B1%A1%E7%9A%84%E5%86%85%E5%AD%98%E5%9C%B0%E5%9D%80%E9%83%BD%E4%B8%8D%E4%B8%80%E6%A0%B7%0A%60%60%60%0A%0A%23%23%20%E6%A8%A1%E5%9D%97%0A%23%23%23%20%E4%BB%80%E4%B9%88%E6%98%AF%E6%A8%A1%E5%9D%97%0A-%20%E6%A8%A1%E5%9D%97%E7%9A%84%E8%8B%B1%E6%96%87%E5%90%8D%E7%A7%B0%EF%BC%9A**Modules**%0A-%20%E5%87%BD%E6%95%B0%E4%B8%8E%E6%A8%A1%E5%9D%97%E7%9A%84%E5%85%B3%E7%B3%BB%EF%BC%9A%E4%B8%80%E4%B8%AA%E6%A8%A1%E5%9D%97%E4%B8%AD%E5%8C%85%E5%90%AB%E5%A4%9A%E4%B8%AA%E5%87%BD%E6%95%B0%0A-%20%E5%9C%A8%20Python%20%E4%B8%AD%E4%B8%80%E4%B8%AA%E6%A8%A1%E5%9D%97%E7%9A%84%E6%96%87%E4%BB%B6%E6%89%A9%E5%B1%95%E5%90%8D%E4%B8%BA%20**.py**%0A-%20%E4%BD%BF%E7%94%A8%E6%A8%A1%E5%9D%97%E7%9A%84%E5%A5%BD%E5%A4%84%EF%BC%9A%0A%20%20%20%201.%20%E6%96%B9%E4%BE%BF%E5%85%B6%E4%BB%96%E7%A8%8B%E5%BA%8F%E5%92%8C%E8%84%9A%E6%9C%AC%E7%9A%84%E5%AF%BC%E5%85%A5%E5%B9%B6%E4%BD%BF%E7%94%A8%0A%20%20%20%202.%20%E9%81%BF%E5%85%8D%E5%87%BD%E6%95%B0%E5%90%8D%E5%92%8C%E5%8F%98%E9%87%8F%E5%90%8D%E5%86%B2%E7%AA%81%0A%20%20%20%203.%20%E6%8F%90%E9%AB%98%E4%BB%A3%E7%A0%81%E7%9A%84%E5%8F%AF%E7%BB%B4%E6%8A%A4%E6%80%A7%0A%20%20%20%204.%20%E6%8F%90%E9%AB%98%E4%BB%A3%E7%A0%81%E7%9A%84%E5%8F%AF%E9%87%8D%E7%94%A8%E6%80%A7%0A!%5B0457146f40f419745244671aa45b803b.png%5D(en-resource%3A%2F%2Fdatabase%2F1339%3A1)%0A%0A%23%23%23%20%E8%87%AA%E5%AE%9A%E4%B9%89%E6%A8%A1%E5%9D%97%0A-%20%E6%96%B0%E5%BB%BA%E4%B8%80%E4%B8%AA%20**.py**%20%E6%96%87%E4%BB%B6%EF%BC%8C%E5%90%8D%E7%A7%B0%E4%B8%8D%E8%A6%81%E4%B8%8E%20Python%20%E8%87%AA%E5%B8%A6%E7%9A%84%E6%A0%87%E5%87%86%E6%A8%A1%E5%9D%97%E5%90%8D%E7%A7%B0%E7%9B%B8%E5%90%8C%0A%0A%23%23%23%20%E5%AF%BC%E5%85%A5%E6%A8%A1%E5%9D%97%0A-%20import%20%E6%A8%A1%E5%9D%97%E5%90%8D%E7%A7%B0%20%5Bas%20%E5%88%AB%E5%90%8D%5D%0A-%20from%20%E6%A8%A1%E5%9D%97%E5%90%8D%E7%A7%B0%20import%20%E5%87%BD%E6%95%B0%2F%E5%8F%98%E9%87%8F%2F%E7%B1%BB%0A%60%60%60python%0A%231.%E5%BC%95%E5%85%A5%E6%A8%A1%E5%9D%97%E5%90%8D%E7%A7%B0%0Aimport%20math%20%23%E5%BC%95%E5%85%A5%E4%B8%80%E4%B8%AA%E6%95%B0%E5%AD%A6%E8%BF%90%E7%AE%97%E7%9A%84%E6%A8%A1%E5%9D%97%0Aprint(math.pi)%20%20%23%E8%B0%83%E7%94%A8%20math%20%E6%A8%A1%E5%9D%97%E4%B8%AD%E7%9A%84%20pi%20%E5%87%BD%E6%95%B0%EF%BC%8C%E8%BE%93%E5%87%BA%E4%B8%80%E4%B8%AA%CF%80%E7%9A%84%E6%95%B0%E5%80%BC%EF%BC%8C%E6%98%BE%E7%A4%BA%EF%BC%9A3.1415926%0Aprint(dir(math))%20%23%E6%9F%A5%E8%AF%A2%20math%20%E6%A8%A1%E5%9D%97%E4%B8%AD%E7%9A%84%E6%89%80%E6%9C%89%E5%8F%AF%E6%93%8D%E4%BD%9C%E7%9A%84%E5%87%BD%E6%95%B0%E6%88%96%E6%96%B9%E6%B3%95%0A%0A%232.%E5%BC%95%E5%85%A5%E6%9F%90%E4%B8%AA%E6%A8%A1%E5%9D%97%E4%B8%AD%E7%9A%84%E5%87%BD%E6%95%B0%E3%80%81%E5%8F%98%E9%87%8F%E6%88%96%E7%B1%BB%0Afrom%20math%20import%20pi%0Afrom%20math%20import%20pow%0A%0Aprint(pi)%0Aprint(pow(2%2C3))%0A%60%60%60%0A%0A%23%23%23%20%E4%BB%A5%E4%B8%BB%E7%A8%8B%E5%BA%8F%E5%BD%A2%E5%BC%8F%E8%BF%90%E8%A1%8C%0A-%20%E5%9C%A8%E6%AF%8F%E4%B8%AA%E6%A8%A1%E5%9D%97%E7%9A%84%E5%AE%9A%E4%B9%89%E4%B8%AD%E9%83%BD%E5%8C%85%E6%8B%AC%E4%B8%80%E4%B8%AA%E8%AE%B0%E5%BD%95%E6%A8%A1%E5%9D%97%E5%90%8D%E7%A7%B0%E7%9A%84%E5%8F%98%E9%87%8F%20**%5C_%5C_name%5C_%5C_**%EF%BC%8C%E7%A8%8B%E5%BA%8F%E5%8F%AF%E4%BB%A5%E6%A3%80%E6%9F%A5%E8%AF%A5%E5%8F%98%E9%87%8F%EF%BC%8C%E4%BB%A5%E7%A1%AE%E5%AE%9A%E4%BB%96%E4%BB%AC%E5%9C%A8%E5%93%AA%E4%B8%AA%E6%A8%A1%E5%9D%97%E4%B8%AD%E6%89%A7%E8%A1%8C%E3%80%82%E5%A6%82%E6%9E%9C%E4%B8%80%E4%B8%AA%E6%A8%A1%E5%9D%97%E4%B8%8D%E6%98%AF%E8%A2%AB%E5%AF%BC%E5%85%A5%E5%88%B0%E5%85%B6%E4%BB%96%E6%A8%A1%E5%9D%97%E4%B8%AD%E6%89%A7%E8%A1%8C%EF%BC%8C%E9%82%A3%E4%B9%88%E5%AE%83%E5%8F%AF%E8%83%BD%E5%9C%A8%E8%A7%A3%E9%87%8A%E5%99%A8%E7%9A%84%E9%A1%B6%E7%BA%A7%E6%A8%A1%E5%9D%97%E4%B8%AD%E6%89%A7%E8%A1%8C%E3%80%82%E9%A1%B6%E7%BA%A7%E6%A8%A1%E5%9D%97%E7%9A%84%20**%5C_%5C_name%5C_%5C_**%20%E5%8F%98%E9%87%8F%E7%9A%84%E5%80%BC%E4%B8%BA%20**%5C_%5C_main%5C_%5C_**%0A%60%60%60python%0A%23%20%E5%88%9B%E5%BB%BA%E6%96%87%E4%BB%B6%20calc.py%20%E6%96%87%E4%BB%B6%0Adef%20add(a%2Cb)%3A%0A%20%20%20%20return%20a%2Bb%0A%0Aif%20__name__%20%3D%20'__main__'%3A%0A%20%20%20%20print(add(10%2C20))%0A%0A%231.%E5%BD%93%E5%85%B6%E4%BB%96%E6%96%87%E4%BB%B6%E8%B0%83%E7%94%A8%E4%BA%86%20calc.py%20%E6%96%87%E4%BB%B6%EF%BC%8Cprint%20%E4%B8%8D%E4%BC%9A%E8%A2%AB%E6%89%A7%E8%A1%8C%0A%232.%E5%BD%93%20calc.py%20%E6%96%87%E4%BB%B6%E6%9C%AC%E8%BA%AB%E8%A2%AB%E6%89%A7%E8%A1%8C%EF%BC%8Cprint%20%E4%BC%9A%E6%89%A7%E8%A1%8C%E8%BE%93%E5%87%BA%EF%BC%8C%E5%9B%A0%E4%B8%BA%20calc.py%20%E6%96%87%E4%BB%B6%E8%A2%AB%E4%B8%BB%E5%8A%A8%E6%89%A7%E8%A1%8C%E6%97%B6%EF%BC%8C__name__%20%E4%BC%9A%E8%A2%AB%E6%A0%87%E8%AE%B0%E4%B8%BA%E5%BD%93%E5%89%8D%E7%A8%8B%E5%BA%8F%20__main__%0A%60%60%60%0A%0A%23%23%23%20%E5%8C%85%0A-%20%E5%8C%85%E6%98%AF%E4%B8%80%E4%B8%AA%E5%88%86%E5%B1%82%E6%AC%A1%E7%9A%84%E7%9B%AE%E5%BD%95%E7%BB%93%E6%9E%84%EF%BC%8C%E5%AE%83%E5%B0%86%E4%B8%80%E7%BB%84%E5%8A%9F%E8%83%BD%E7%9B%B8%E8%BF%91%E7%9A%84%E6%A8%A1%E5%9D%97%E7%BB%84%E7%BB%87%E5%9C%A8%E4%B8%80%E4%B8%AA%E7%9B%AE%E5%BD%95%E4%B8%8B%0A-%20%E4%BD%9C%E7%94%A8%EF%BC%9A%0A%20%20%20%201.%20%E4%BB%A3%E7%A0%81%E8%A7%84%E8%8C%83%0A%20%20%20%202.%20%E9%81%BF%E5%85%8D%E6%A8%A1%E5%9D%97%E5%90%8D%E7%A7%B0%E5%86%B2%E7%AA%81%0A%0A-%20%E5%8C%85%E4%B8%8E%E7%9B%AE%E5%BD%95%E7%9A%84%E5%8C%BA%E5%88%AB%0A%20%20%20%201.%20%E5%8C%85%EF%BC%9A%E5%90%AB%20**%5C_%5C_init%5C_%5C_.py**%20%20%E6%96%87%E4%BB%B6%E7%9A%84%E7%9B%AE%E5%BD%95%E7%A7%B0%E4%B8%BA%E5%8C%85%EF%BC%8C**%E4%B8%80%E4%B8%AA%E5%8C%85%E5%8F%AF%E4%BB%A5%E5%8C%85%E5%90%AB%E5%A4%9A%E4%B8%AA%E6%A8%A1%E5%9D%97**%0A%20%20%20%202.%20%E7%9B%AE%E5%BD%95%EF%BC%9A%E9%87%8C%E4%B8%8D%E5%8C%85%E5%90%AB%20**%5C_%5C_init%5C_%5C_.py**%20%E6%96%87%E4%BB%B6%0A-%20%E5%8C%85%E7%9A%84%E5%AF%BC%E5%85%A5%0A**import%20%E5%8C%85%E5%90%8D.%E6%A8%A1%E5%9D%97%E5%90%8D**%0A%60%60%60python%0A%23%E5%AF%BC%E5%85%A5%E5%8C%85%E4%B8%AD%E7%9A%84%E6%A8%A1%E5%9D%97%20import%20%E5%8C%85%E5%90%8D.%E6%A8%A1%E5%9D%97%E5%90%8D%20as%20%E5%88%AB%E5%90%8D%0Aimport%20pageage1.mouduleA%20as%20ma%0A%0A%23%E8%B0%83%E7%94%A8%E8%AF%A5%E6%A8%A1%E5%9D%97%E9%87%8C%E7%9A%84%E5%87%BD%E6%95%B0%0Aprint(ma.a)%0A%60%60%60%0A%0A%23%23%23%20Python%20%E4%B8%AD%E5%B8%B8%E7%94%A8%E7%9A%84%E5%86%85%E7%BD%AE%E6%A8%A1%E5%9D%97%0A!%5B799db4c726f98d33fe98c90154c37c02.png%5D(en-resource%3A%2F%2Fdatabase%2F1341%3A1)%0A%0A%23%23%23%20%E7%AC%AC%E4%B8%89%E6%96%B9%E6%A8%A1%E5%9D%97%E7%9A%84%E5%AE%89%E8%A3%85%E5%8F%8A%E4%BD%BF%E7%94%A8%0A-%20**%E5%AE%89%E8%A3%85%E7%AC%AC%E4%B8%89%E6%96%B9%E6%A8%A1%E5%9D%97**%0A%60%60%60python%0Apip%20install%20%E6%A8%A1%E5%9D%97%E5%90%8D%0A%60%60%60%0A-%20**%E5%9C%A8%E7%BA%BF%E5%AE%89%E8%A3%85**%0A!%5B6134833ff99ecec29756eb770bea3338.png%5D(en-resource%3A%2F%2Fdatabase%2F1361%3A1)%0A%0A%0A-%20**%E4%BD%BF%E7%94%A8%E7%AC%AC%E4%B8%89%E6%96%B9%E6%A8%A1%E5%9D%97**%0A%60%60%60python%0Aimport%20%E6%A8%A1%E5%9D%97%E5%90%8D%0A%60%60%60%0A%0A%23%23%23%20%E7%9F%A5%E8%AF%86%E6%80%BB%E7%BB%93%0A!%5Bb29fa48803ae8d20a72f7deba9557c3d.png%5D(en-resource%3A%2F%2Fdatabase%2F1363%3A1)%0A%0A%23%23%20%E6%96%87%E4%BB%B6%E7%9B%AE%E5%BD%95%0A%23%23%23%20%E7%BC%96%E7%A0%81%E6%A0%BC%E5%BC%8F%0A-%20**Python%20%E8%A7%A3%E9%87%8A%E5%99%A8%E4%BD%BF%E7%94%A8%E7%9A%84%E6%98%AF%20Unicode%EF%BC%88%E5%86%85%E5%AD%98%EF%BC%89**%0A-%20**.py%20%E6%96%87%E4%BB%B6%E5%9C%A8%E7%A3%81%E7%9B%98%E4%B8%8A%E4%BD%BF%E7%94%A8%20UTF-8%20%E5%AD%98%E5%82%A8%EF%BC%88%E5%A4%96%E5%AD%98%EF%BC%89**%0A!%5Bdd040c55bc661442c89e30337cc7e21f.png%5D(en-resource%3A%2F%2Fdatabase%2F1365%3A1)%0A%0A%23%23%23%20%E6%96%87%E4%BB%B6%E8%AF%BB%E5%86%99%E5%8E%9F%E7%90%86%0A-%20**%E6%96%87%E4%BB%B6%E8%AF%BB%E5%86%99%E4%BF%97%E7%A7%B0%E2%80%9CIO%E6%93%8D%E4%BD%9C%E2%80%9D**%0A-%E5%86%85%E7%BD%AE%E5%87%BD%E6%95%B0%20**open()**%20%E5%88%9B%E5%BB%BA%E6%96%87%E4%BB%B6%E5%AF%B9%E8%B1%A1%0A!%5Bf955e5a4868bcdd93845bb81f88aab0e.png%5D(en-resource%3A%2F%2Fdatabase%2F1367%3A1)%0A-%20**%E8%AF%AD%E6%B3%95%E8%A7%84%E5%88%99**%0A!%5Ba77b4c865861844ef01fde30111fbd7e.png%5D(en-resource%3A%2F%2Fdatabase%2F1369%3A1)%0A%60%60%60Python%0A%23%E5%88%9B%E5%BB%BA%E6%96%87%E4%BB%B6%E5%AF%B9%E8%B1%A1%0Afile1%3Dopen('a.txt'%2C'r')%20%23%E8%AF%BB%E5%8F%96%E4%B8%80%E4%B8%AA%E6%96%87%E4%BB%B6%EF%BC%8C%E6%A8%A1%E5%BC%8F%E4%B8%BA%EF%BC%9A%E5%8F%AA%E8%AF%BB%0A%0A%23%E8%BE%93%E5%87%BA%E6%96%87%E4%BB%B6%E5%86%85%E5%AE%B9%0Aprint(file1.readlines())%20%23%20readlines()%20%E8%AF%BB%E5%8F%96%E7%9A%84%E6%98%AF%E4%B8%80%E4%B8%AA%E2%80%9C%E5%88%97%E8%A1%A8%E2%80%9D%0A%0A%23%E5%85%B3%E9%97%AD%E7%B3%BB%E7%BB%9F%E8%B5%84%E6%BA%90%0Afile1.close()%0A%60%60%60%0A%0A%23%23%23%20%E6%96%87%E4%BB%B6%E8%AF%BB%E5%86%99%E6%93%8D%E4%BD%9C%0A-%20%E6%96%87%E4%BB%B6%E7%9A%84%E7%B1%BB%E5%9E%8B%0A-%20%E6%8C%89%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E6%95%B0%E6%8D%AE%E7%BB%84%E7%BB%87%E5%BD%A2%E5%BC%8F%EF%BC%8C%E6%96%87%E4%BB%B6%E5%88%86%E4%B8%BA%E4%B8%A4%E5%A4%A7%E7%B1%BB%E5%9E%8B%EF%BC%9A%0A%20%20%20%201.%20%E6%96%87%E6%9C%AC%E6%96%87%E4%BB%B6%EF%BC%9A%E5%AD%98%E5%82%A8%E6%99%AE%E9%80%9A%E2%80%9C%E5%AD%97%E7%AC%A6%E2%80%9D%E6%96%87%E6%9C%AC%EF%BC%8C%E9%BB%98%E8%AE%A4%E4%B8%BA%20Unicode%20%E5%AD%97%E7%AC%A6%E9%9B%86%EF%BC%8C%E5%8F%AF%E4%BB%A5%E4%BD%BF%E7%94%A8%E8%AE%B0%E4%BA%8B%E6%9C%AC%E7%A8%8B%E5%BA%8F%E6%89%93%E5%BC%80%0A%20%20%20%202.%20%E4%BA%8C%E8%BF%9B%E5%88%B6%E6%96%87%E4%BB%B6%EF%BC%9A%E6%8A%8A%E6%95%B0%E6%8D%AE%E5%86%85%E5%AE%B9%E7%94%A8%E2%80%9C%E5%AD%97%E8%8A%82%E2%80%9D%E5%AD%98%E5%82%A8%EF%BC%8C%E6%97%A0%E6%B3%95%E7%94%A8%E8%AE%B0%E4%BA%8B%E6%9C%AC%E6%89%93%E5%BC%80%EF%BC%8C%E5%BF%85%E9%A1%BB%E4%BD%BF%E7%94%A8%E4%B8%93%E7%94%A8%E8%BD%AF%E4%BB%B6%E6%89%93%E5%BC%80%EF%BC%8C%E4%BE%8B%EF%BC%9Amp3%E9%9F%B3%E9%A2%91%E6%96%87%E4%BB%B6%E3%80%81png%E5%9B%BE%E7%89%87%E6%96%87%E4%BB%B6%E3%80%81doc%E6%96%87%E6%A1%A3%20%E7%AD%89%0A!%5Bb4cc5d8abe52355dbbfa6d056c2bf740.png%5D(en-resource%3A%2F%2Fdatabase%2F1371%3A1)%0A%60%60%60python%0A%23%E5%88%9B%E5%BB%BA%E5%86%99%E5%85%A5%E7%9A%84%E6%96%87%E4%BB%B6%E5%AF%B9%E8%B1%A1%0A%23%20w%20%E5%86%99%E5%85%A5%EF%BC%8C%E8%A6%86%E7%9B%96%E5%8E%9F%E6%96%87%E4%BB%B6%0A%23%20a%20%E5%86%99%E5%85%A5%EF%BC%8C%E5%9C%A8%E5%8E%9F%E6%96%87%E4%BB%B6%E5%86%85%E5%AE%B9%E5%90%8E%E8%BF%BD%E5%8A%A0%E5%86%85%E5%AE%B9%0Afile2%3Dopen('b.txt'%2C'w')%20%23%E6%A8%A1%E5%BC%8F%E4%B8%BA%EF%BC%9A%E5%86%99%0A%0A%23%E5%86%99%E5%85%A5%E4%BF%A1%E6%81%AF%0Afile2.write('hello%20world')%20%20%23%E5%A6%82%E6%9E%9C%E6%96%87%E4%BB%B6%E5%AD%98%E5%9C%A8%EF%BC%8C%E5%88%99%E5%86%99%E5%85%A5%E6%93%8D%E4%BD%9C%E4%BC%9A%E8%A6%86%E7%9B%96%E5%8E%9F%E6%96%87%E4%BB%B6%0A%23%E5%85%B3%E9%97%AD%E7%B3%BB%E7%BB%9F%E8%B5%84%E6%BA%90%0Afile2.close()%0A%0A%23%E5%AF%B9%E4%BA%8C%E8%BF%9B%E5%88%B6%E6%96%87%E4%BB%B6%E7%9A%84%E8%AF%BB%E5%86%99%E6%93%8D%E4%BD%9C%0Asrc_file%3Dopen('logo.png'%2C'rb')%20%20%23%E5%88%9B%E5%BB%BA%E5%8F%AA%E8%AF%BB%E7%9A%84%E5%9B%BE%E5%83%8F%E6%96%87%E4%BB%B6%E5%AF%B9%E8%B1%A1%0Atarget_file%3Dopen('copylogo.png'%2C'rb')%20%20%20%23%E5%88%9B%E5%BB%BA%E5%8F%AA%E5%86%99%E7%9A%84%E5%9B%BE%E5%83%8F%E6%96%87%E4%BB%B6%E5%AF%B9%E8%B1%A1%0A%0A%23%E8%AF%BB%E5%8F%96%20src_file%20%E6%96%87%E4%BB%B6%E5%AF%B9%E8%B1%A1%EF%BC%8C%E5%B9%B6%E5%86%99%E5%85%A5%E5%88%B0%20target_file%20%E6%96%87%E4%BB%B6%E5%AF%B9%E8%B1%A1%E4%B8%AD%0Atarget_file.write(src_file.read())%0A%0A%23%E5%85%B3%E9%97%AD%E7%B3%BB%E7%BB%9F%E8%B5%84%E6%BA%90%0Atarget_file.close()%0Asrc_file.close()%0A%0A%23%E6%9C%80%E5%90%8E%EF%BC%8C%2B%20%E5%8F%B7%E8%A1%A8%E7%A4%BA%E4%BB%A5%E8%AF%BB%E5%86%99%E7%9A%84%E6%96%B9%E5%BC%8F%E6%89%93%E5%BC%80%EF%BC%8C%E9%9C%80%E8%A6%81%E4%B8%8E%E5%85%B6%E4%BB%96%E6%A8%A1%E5%BC%8F%E4%B8%80%E8%B5%B7%E4%BD%BF%E7%94%A8%EF%BC%8C%E4%BE%8B%EF%BC%9Aa%2B%0A%60%60%60%0A%0A%23%23%23%20%E6%96%87%E4%BB%B6%E5%AF%B9%E8%B1%A1%E5%B8%B8%E7%94%A8%E6%96%B9%E6%B3%95%0A!%5B970d1c057f2a741577e5827820c6e48b.png%5D(en-resource%3A%2F%2Fdatabase%2F1373%3A1)%0A%0A%23%23%23%20with%E8%AF%AD%E5%8F%A5%EF%BC%88%E4%B8%8A%E4%B8%8B%E6%96%87%E7%AE%A1%E7%90%86%E5%99%A8%EF%BC%89%0A-%20**with**%20%E8%AF%AD%E5%8F%A5%E5%8F%AF%E4%BB%A5%E8%87%AA%E5%8A%A8%E7%AE%A1%E7%90%86%E4%B8%8A%E4%B8%8B%E6%96%87%E8%B5%84%E6%BA%90%EF%BC%8C%E4%B8%8D%E8%AE%BA%E4%BB%80%E4%B9%88%E5%8E%9F%E5%9B%A0%E8%B7%B3%E5%87%BA%20with%20%E5%9D%97%EF%BC%8C%E9%83%BD%E8%83%BD%E7%A1%AE%E4%BF%9D%E6%96%87%E4%BB%B6%E6%AD%A3%E7%A1%AE%E5%85%B3%E9%97%AD%EF%BC%8C%E4%BB%A5%E6%AD%A4%E6%9D%A5%E8%BE%BE%E5%88%B0%E9%87%8A%E6%94%BE%E8%B5%84%E6%BA%90%E7%9A%84%E7%9B%AE%E7%9A%84%0A!%5B69c2522407b32d16b86ef12baf280084.png%5D(en-resource%3A%2F%2Fdatabase%2F1375%3A1)%0A%60%60%60python%0A%0Awith%20open('a.txt'%2C'r')%20as%20file1%3A%0A%20%20%20%20print(file1.read())%0A%23%E8%AF%AD%E5%8F%A5%E6%9C%80%E5%90%8E%20with%20%E4%BC%9A%E8%87%AA%E5%8A%A8%E5%85%B3%E9%97%AD%E9%87%8A%E6%94%BE%EF%BC%8C%E8%80%8C%E4%B8%8D%E9%9C%80%E8%A6%81%E4%BA%BA%E4%B8%BA%E5%86%99%E5%85%B3%E9%97%AD%E8%AF%AD%E5%8F%A5%0A%0A%23%E5%AE%8C%E6%95%B4%E7%9A%84%E8%B5%8B%E5%80%BC%E7%B2%98%E8%B4%B4%E4%B8%80%E5%BC%A0%E5%9B%BE%E7%89%87%E7%9A%84%E4%BB%A3%E7%A0%81%E5%B0%B1%E6%98%AF%E4%B8%89%E8%A1%8C%0Awith%20open('logo.png'%2C'rb')%20as%20src_file%3A%0A%20%20%20%20with%20open('copy2logo.png'%2C'wb')%20as%20target_file%3A%0A%20%20%20%20%20%20%20%20target_file.write(src_file.read())%0A%60%60%60%0A%0A%23%23%23%20%E7%9B%AE%E5%BD%95%E6%93%8D%E4%BD%9C%0A-%20**OS**%20%E6%A8%A1%E5%9D%97%E6%98%AF%20Python%20%E5%86%85%E7%BD%AE%E7%9A%84%E4%B8%8E%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E5%8A%9F%E8%83%BD%E5%92%8C%E6%96%87%E4%BB%B6%E7%B3%BB%E7%BB%9F%E7%9B%B8%E5%85%B3%E7%9A%84%E6%A8%A1%E5%9D%97%EF%BC%8C%E8%AF%A5%E6%A8%A1%E5%9D%97%E4%B8%AD%E7%9A%84%E8%AF%AD%E5%8F%A5%E6%89%A7%E8%A1%8C%E7%BB%93%E6%9E%9C%E9%80%9A%E5%B8%B8%E4%B8%8E%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E6%9C%89%E5%85%B3%EF%BC%8C%E5%9C%A8%E4%B8%8D%E5%90%8C%E7%9A%84%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E4%B8%8A%E8%BF%90%E8%A1%8C%EF%BC%8C%E5%BE%97%E5%88%B0%E7%9A%84%E7%BB%93%E6%9E%9C%E5%8F%AF%E8%83%BD%E4%B8%8D%E4%B8%80%E6%A0%B7%0A-%20OS%20%E6%A8%A1%E5%9D%97%E4%B8%8E%20**OS.path**%20%E6%A8%A1%E5%9D%97%E7%94%A8%E4%BA%8E%E5%AF%B9%E7%9B%AE%E5%BD%95%E6%88%96%E6%96%87%E4%BB%B6%E8%BF%9B%E8%A1%8C%E6%93%8D%E4%BD%9C%0A%60%60%60python%0A%23%E6%89%93%E5%BC%80%E6%93%8D%E4%BD%9C%E7%B3%BB%E7%BB%9F%E7%9A%84%E8%AE%B0%E4%BA%8B%E6%9C%AC%0Aimport%20os%0Aos.system('notepad.exe')%0A%0A%23%E8%B0%83%E7%94%A8%E7%B3%BB%E7%BB%9F%E4%B8%AD%E7%9A%84%E5%8F%AF%E6%89%A7%E8%A1%8C%E6%96%87%E4%BB%B6%EF%BC%8C%E4%BE%8B%E5%A6%82%E6%89%93%E5%BC%80QQ%0Aos.startfile('C%3A%5C%5CProgram%20Files%20(x86)%5C%5CTencent%5C%5CQQ%5C%5CBin%5C%5CQQ.exe')%0A%60%60%60%0A-%20**OS%20%E6%A8%A1%E5%9D%97%E6%93%8D%E4%BD%9C%E7%9B%AE%E5%BD%95%E7%9B%B8%E5%85%B3%E5%87%BD%E6%95%B0**%0A!%5Bdecc4f0f013f24eb817a5cff8325a0da.png%5D(en-resource%3A%2F%2Fdatabase%2F1377%3A1)%0A%0A-%20**OS.path%20%E6%A8%A1%E5%9D%97%E6%93%8D%E4%BD%9C%E7%9B%AE%E5%BD%95%E7%9B%B8%E5%85%B3%E5%87%BD%E6%95%B0**%0A!%5Ba8bbfee236099782900f625c9c136d78.png%5D(en-resource%3A%2F%2Fdatabase%2F1379%3A1)%0A%60%60%60python%0A%23%20walk%20%E6%96%B9%E6%B3%95%E5%8F%AF%E4%BB%A5%E8%8E%B7%E5%8F%96%E5%BD%93%E5%89%8D%E7%9B%AE%E5%BD%95%E4%B8%8B%E6%89%80%E6%9C%89%E6%96%87%E4%BB%B6%E5%8F%8A%E5%AD%90%E7%9B%AE%E5%BD%95%E9%87%8C%E7%9A%84%E6%89%80%E6%9C%89%E6%96%87%E4%BB%B6%0Aimport%20os%0Apath%3Dos.getcwd()%0Alst_files%3Dos.walk(path)%0Afor%20dirpath%2Cdirname%2Cfilename%20in%20lst_files%3A%0A%20%20%20%20print(dirpath)%0A%20%20%20%20print(dirname)%0A%20%20%20%20print(filename)%0A%20%20%20%20print('-----------%20%E5%88%86%E5%89%B2%E7%BA%BF%20-----------')%0A%60%60%60%0A%0A%23%23%23%20%E7%9F%A5%E8%AF%86%E6%80%BB%E7%BB%93%0A!%5B751da2720517c54dd94a5e158140453b.png%5D(en-resource%3A%2F%2Fdatabase%2F1381%3A1)%0A%0A%0A%23%23%20%E5%85%B6%E4%BB%96%E7%9F%A5%E8%AF%86%0A%23%23%23%20%E9%A1%B9%E7%9B%AE%E6%89%93%E5%8C%85%0A-%20**%E5%AE%89%E8%A3%85%E7%AC%AC%E4%B8%89%E6%96%B9%E6%A8%A1%E5%9D%97**%0A-%20%E5%9C%A8%E7%BA%BF%E5%AE%89%E8%A3%85%E6%96%B9%E5%BC%8F%0A-%20%E8%AF%AD%E6%B3%95%EF%BC%9Apip%20install%20PyInstaller%0A-%20%E6%89%A7%E8%A1%8C%E6%89%93%E5%8C%85%E6%93%8D%E4%BD%9C%0A!%5B1829ab210e22e45cd8f1fd6ea282d305.png%5D(en-resource%3A%2F%2Fdatabase%2F1383%3A0)%0A%60%60%60%0AC%3A%5CUsers%5CAdministrator%3Epyinstaller%20-F%20E%3A%5CPython%5CStudentsys%5Cstudent.py%0A%60%60%60%0A-%20**-F**%20%E8%A1%A8%E7%A4%BA%E5%8F%AA%E7%94%9F%E6%88%90%E4%B8%80%E4%B8%AA%20.exe%20%E6%96%87%E4%BB%B6%0A

(0)

相关推荐

  • Python常见基础知识点汇总(建议时常翻阅)

    列表是一种不同数据类型元素的有序集合.与元组和字符串不同的是,列表中的元素是可变的,也就是可以随时添加或删除其中的元素. 列表通过方括号"[]"加以表示. 1.列表变量的定义 1) ...

  • 小白到精英必备的100多个Python函数汇总,新手也能流畅写代码

    新手在做写代码的时候容易卡壳,尤其当接触的函数以及其他知识比较多的时候,经常会看完需求之后不知道自己该用什么方法来实现它,实现的逻辑可能你有,但怎么该用什么函数给忘了,这其实就是知识的储备不够,你记不 ...

  • 收藏!20条非常实用的Python代码实例

    据说Python之父-Guido Van Rossum打算让CPython更快,速度直接翻五倍,这是实实在在的好消息. Python一直以来被诟病速度慢,影响开发效率,希望这次Guido老爷子能帮py ...

  • 《Python编程:从入门到实践》语法知识点总结 这一篇就够了

    <Python编程:从入门到实践>语法知识点总结 友情提醒:本文中函数方法表格初学者不必全部记下来,只需要保存图片或者收藏本文,使用时自己方便查询即可. 本文同样有关于Python语法的细 ...

  • Python所有核心知识都在这14张思维导图了!

    大数据分析和人工智能 3月1日 本文主要涵盖了 Python 编程的核心知识(暂不包括标准库及第三方库). 1. 按顺序依次展示了以下内容的一系列思维导图: 基础知识 数据类型(数字,字符串,列表,元 ...

  • python最新详解

    python最新内容详解:Python 简介Python 是一门流行的编程语言.它由 Guido van Rossum 创建,于 1991 年发布.Python3 如何安装环境搭建介绍如何在本地搭建 ...

  • python菜鸟教程学习12:输入输出

    Python两种输出值的方式: 表达式语句 print()函数 文件对象的 write() 方法,标准输出文件可以用 sys.stdout 引用. 如果你希望输出的形式更加多样,可以使用 str.fo ...

  • python菜鸟教程学习11:模块

    如果你从 Python 解释器退出再进入,那么你定义的所有的方法和变量就都消失了.为此 Python 提供了一个办法,把这些定义存放在文件中,为一些脚本或者交互式的解释器实例使用,这个文件被称为模块. ...

  • python菜鸟教程学习10:数据结构

    列表方法 list.append(x):把一个元素添加到列表的结尾,相当于 a[len(a):] = [x]. list.extend(L):通过添加指定列表的所有元素来扩充列表,相当于 a[len( ...

  • 临王羲之《圣教序》笔法教程学习笔记,56张单字教程,学行书收藏

    原创大勇书法2019-01-17 15:16:42 <大唐三藏圣教序> <大唐三藏圣教序>简称<圣教序>,由唐太宗撰写.最早由唐初四大书法家之一的褚遂良所书称为&l ...

  • python菜鸟教程学习9:函数

    函数的定义 函数是组织好的,可重复使用的,用来实现单一,或相关联功能的代码段.python提供了很多内建函数,但我们依然可以自己创建函数,叫做用户自定义函数. 自定义函数 你可以定义一个由自己想要功能 ...

  • python菜鸟教程学习8:迭代器与生成器

    迭代器 python最强大的功能之一,访问集合元素的一种方式.迭代器是一个可以记住遍历的位置的对象,迭代器对象从集合的第一个元素开始访问,直到所有的元素被访问完结束,迭代器只能往前不会后退. 迭代器有 ...

  • Python 操作 Excel 学习笔记

    Python 操作 Excel 文章目录 Python 操作 Excel xlrd 安装 创建工作簿并添加工作表 调整单元格样式 填充数据 写入数据 插入图片 保存文件 xlrd 安装 xlrd 常用 ...

  • 没有经验有没有学习开水果店的教程,开水果店的全套教程学习

    想开水果店,但是是新手,有没有什么教程可以学习一下,开水果店需要学习的内容挺多,教程只能作为参考,具体的还是需要自己摸索出适合自己店铺的经营方式,水果店主圈子已整理出全套新手开水果店入门学习资料教程. ...

  • python基础语法学习笔记

    学习来源:https://www.bilibili.com/video/BV1Vt411z7Kg?p=11 一.变量是什么? 变量来源于数学,是计算机语言中,能储存计算结果,或能表示值抽象的概念.变量 ...