久久国产成人av_抖音国产毛片_a片网站免费观看_A片无码播放手机在线观看,色五月在线观看,亚洲精品m在线观看,女人自慰的免费网址,悠悠在线观看精品视频,一级日本片免费的,亚洲精品久,国产精品成人久久久久久久

分享

Python 全套教程 學(xué)習(xí)筆記

 dakawang 2020-12-25

Python 全套教程 學(xué)習(xí)筆記

print()函數(shù)

  • 輸出數(shù)字,、字符串、含運算符的表達式
print(520) print('Hello world') print('Hello world') print(3 1) #將數(shù)據(jù)輸出文件中 fp=open('d:/text.txt','a ') #a 如果文件不存在就創(chuàng)建,,存在就在文件內(nèi)容的后面繼續(xù)追加 print('Hello world',file=fp) fp.close() #逗號,,不進行換行輸出(輸出內(nèi)容在一行當中) print('Hello','World','Python')

轉(zhuǎn)義字符

  • 什么是轉(zhuǎn)移字符?
    • 反斜杠 想要實現(xiàn)的轉(zhuǎn)移功能首字母,。
  • 為什么需要轉(zhuǎn)移字符,?
    • 當字符串中包含反斜杠、單引號和雙引號等有特殊用途的字符時,,必須使用反斜杠對這些字符進行轉(zhuǎn)義(轉(zhuǎn)換一個含義)
      • 反斜杠:\
      • 單引號:'
      • 雙引號:'
    • 當字符串中包含換行,、回車,,水平制表符或退格等無法直接表示的特殊字符時,也可以使用轉(zhuǎn)義字符當字符串中包含換行,、回車,,水平制表符或退格等無法直接表示的特殊字符時,也可以使用轉(zhuǎn)義字符
      • 換行:\n
      • 回車:\r
      • 水平制表符:\t
      • 退格:\b
print('Hello\nworld')
print('Hello\tworld')
print('Hello\bworld')
print('http:\\\\www.baidu.com')
print('老實說:\'大家好\'')
#原字符,,讓字符串中的轉(zhuǎn)移字符不起作用
print(r'Hello\nworld')

二進制與字符編碼

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

Python中的標識符和保留字

變量的定義和使用

name='馬麗亞'
print(name)
print('標識',id(name))
print('類型',type(name))
print('值',name)


數(shù)據(jù)類型

針對浮點類型(float)存儲不精確的問題,,解決方案是:導(dǎo)入模塊 decimal

from decimal import Decimal print(Decimal('1.1') Decimal('2.2')) #不會出現(xiàn)小數(shù)位不精確的情況了

布爾型(bool)可以轉(zhuǎn)換成整數(shù)型

print(True 1)

字符串類型可以使用單引號、雙引號,、三引號定義,,其中:單引號、和雙引號定義的字符串必須在一行,,三引號的字符串可以分布在連續(xù)的多行

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

數(shù)據(jù)類型轉(zhuǎn)換

name='張三'
age=20
print(type(name),type(age))
print('我叫' name ',,今年' str(age) '歲。') #將 int 類型通過 str() 轉(zhuǎn)換成字符串類型,。

Python中的注釋

input()輸入函數(shù)

作用:接收來自用戶的輸入
返回值類型:輸入值的類型為str
值的存儲:使用=對輸入的值進行存儲

present=input('大圣想要什么禮物呢,?') a=input('請輸入一個加數(shù):') #輸入的數(shù)字為str類型的 a=int(a) #對輸入的數(shù)據(jù)轉(zhuǎn)換 b=input('請輸入另一個加數(shù):') #輸入的數(shù)字為str類型的 b=int(b) #對輸入的數(shù)據(jù)轉(zhuǎn)換 print(a b) #第二種方式實現(xiàn) a=int(input('請輸入一個加數(shù):')) b=int(input('請輸入另一個加數(shù):'))

Python中的運算符



#取余運算符
print(11%2) #等于1,余數(shù)是1

#冪運算符
print(2**2) #表示 2 的 2 次方
print(2**3) #表示 2 的 3次方,,也就是 2*2*2 = 8

#賦值運算符舉例 a=20 a =30 print(a) #結(jié)果是50,,相當于 a 30 #解包賦值舉例 a,b,c=20,30,40 #左右個數(shù)需一致 #比較運算符的結(jié)果為bool類型,比較的是值 # is 標識比較符 print('a>b嗎,?',a>b) # False print(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) #True print('k' in s) #False print('w' not in s) #False print('k' not in s) #True

print(4&8) #按位與&,,同為1時結(jié)果為1
print(4|8) #按位或|,同為0時結(jié)果為0
print(4<<1) #向左移動1位,,相當于 乘以 2
print(4>>2) #向右移動2位,,相當于 除以 4

程序的組織結(jié)構(gòu)

三種基本結(jié)構(gòu)組成:順序結(jié)構(gòu)選擇結(jié)構(gòu),、循環(huán)結(jié)構(gòu)
Python一切皆對象,,所有對象都有一個布爾值

# 單分支結(jié)構(gòu) money=1000 s=int(input('請輸入取款金額:')) if money>=s: money=money-s print('取款成功,,余額為:',money) # 雙分支結(jié)構(gòu) if money>=s: money=money-s print('取款成功,,余額為:',money) else: print('余額不足') # 多分支結(jié)構(gòu) 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=10 b=20 print(str(a) '大于等于' str(b) if a>=b else str(a) '小于' str(b)) # pass語句,,什么都不做,,只是一個占位符,用到需要寫語句的地方,,用于前期搭建代碼結(jié)構(gòu)的地方 if answer=='y': pass else: pass # while 循環(huán) a=1 while a<10: print(a) a =1 # for-in 循環(huán) for item in 'python': print(item) # break 語句,,用于結(jié)束循環(huán)結(jié)構(gòu),,通常與分支結(jié)構(gòu) if 一起使用 # continue 語句,用于結(jié)束當前循環(huán),,進入下一個循環(huán),,通常與分支結(jié)構(gòu) if 一起使用
  • else 與語句
  • 與 else 語句配合使用的三種情況為:if-else \ while-else \ for-else

列表

  • 列表需要使用中括號[],元素間用英文逗號分隔
lst=['hello','world',98]
  • 創(chuàng)建列表第二種方式,,使用內(nèi)置函數(shù) list()
lst2=(['hello','world',98])

列表的特點
列表元素按順序有序排序
索引映射唯一個數(shù)據(jù)
列表可以存儲重復(fù)數(shù)據(jù)
任意數(shù)據(jù)類型混存
根據(jù)需要動態(tài)分配和回收內(nèi)存

列表的查詢操作

  • 獲取列表中指定元素的索引 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)) #指定范圍內(nèi),,查找索引 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,、最大索引,、1
print(lst[::1]) #正向step
print(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 #在列表的任務(wù)位置添加至少一個元素,,從索引1往后的元素切掉,,lst3替換進來

列表元素的刪除操作

lst.remove(30) #刪除一個元素,如果有重復(fù)元素,,只刪除第一個元素,,如果元素不存在則拋錯 ValueError
lst.pop(1) #刪除索引為1的元素
lst.pop(5) #刪除索引為5的元素,如果指定的索引位置不存在將拋錯,,如果不指定參數(shù)則刪除列表最后一個元素
lst[1:3]=[] #切片,,將當前列表的1到3索引的元素通過傳入空的方式刪除
lst2=lst[1:3] #切片,產(chǎn)生新的列表,,原列表不改變
lst.clear() #刪除列表中所有元素
del lst #刪除列表對象

列表元素的修改操作

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

列表元素的排序操作

  • 調(diào)用 sort() 方法,,列表中的所有元素默認按照從小到大的順序排序,可以指定 reverse=True,,進行降序排序
lst.sort() lst.sort(reverse=True)
  • 調(diào)用內(nèi)置函數(shù) sorted(),,可以指定 reverse=True,進行降序排序,,原列表不發(fā)生改變
lst2=sorted(lst) #函數(shù)產(chǎn)生新的列表對象
lst3=sorted(lst,reverse=True)

列表生成的公式

語法格式

# [ i*i for i in range(1,10) ] #注意事項:“表示列表元素的表達式”中通常包含自定義變量 lst=[i for i in range(1,10)] #產(chǎn)生1到9的列表 lst=[i*2 for i in range(1,10)] #產(chǎn)生2,4,、6、8,、10的列表

字典

什么是字典

Python 內(nèi)置的數(shù)據(jù)結(jié)構(gòu)之一,,與列表一樣是一個可變序列
以鍵值對的方式存儲數(shù)據(jù),字典是一個無序的序列

字典的原理

字典以大括號表示

scores={ '張三':100,'李四':98,'王五':45 }
  • 字典的實現(xiàn)原理與查字典類似,,查字典是先根據(jù)部首或拼音查找對應(yīng)的頁碼,,Python 中的字典是根據(jù) key 查找 value 所在的位置。

字典的創(chuàng)建與刪除

  • 字典的創(chuàng)建
scores={ '張三':100,'李四':98,'王五':45 }
  • 使用內(nèi)置函數(shù) dict()
dict(name='jack',age=20)

字典的常用操作

  • 獲取字典中的元素
  1. [] 舉例:scores['張三']
  2. get() 方法 舉例:scores.get('張三')
print(scores['張三']) #如果找不到,,則會拋錯 print(scores.get('張三')) #如果找不到,,則不會拋錯,,返回 None print(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. 將字典轉(zhuǎn)換成列表
items=scores.items() list(items)

字典元素的遍歷

for item in scores:
    print(item,scores[item],scores.get(item)) #scores[item] 會拋錯,,scores.get(item) 不會

字典的特點

字典中的所有元素都是一個 key-value 對,key 不允許重復(fù),,value 可以重復(fù)
字典中的元素是無序的
字典中的 key 必須是不可變對象
字典也可以根據(jù)需要動態(tài)滴伸縮
字典會浪費較大的內(nèi)存,,是一種使用空間換時間的數(shù)據(jù)結(jié)構(gòu)

字典生成式

  • 內(nèi)置函數(shù) zip()
    用于將可迭代的對象作為參數(shù),將對象中對應(yīng)的元素打包成一個元組,,然后返回由這些元組組成的列表
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)} #如果鍵值對數(shù)量不匹配,,以數(shù)量少的一方展示

元組

Python 內(nèi)置的數(shù)據(jù)結(jié)構(gòu)之一,是一個不可變序列
不可變序列和可變序列
不可變序列:字符串,、元組,,沒有增、刪,、改操作
可變序列:列表,、字典,可以對序列執(zhí)行增,、刪,、改操作,對象地址不發(fā)生更改

元組的創(chuàng)建方式

  • 直接小括號
t=( 'Python','Hello', 90 )
  • 使用內(nèi)置函數(shù) tuple()
t=tuple(( 'Python','Hello', 90 ))
  • 只包含一個元祖的元素需要使用逗號和小括號
t=(10, )
  • 可以簡寫為
t='Python','Hello', 90
  • 空元組的創(chuàng)建
t=()
t=tuple()

為什么要將元組設(shè)計成不可變序列

  • 在多任務(wù)環(huán)境下,,同時操作對象時不需要加鎖,,因此在程序中盡量使用不可變序列
  • 注意事項:元組中存車處的是對象的引用
    1. 如果元組中對象本身不可對象,則不能再引用其他對象
    2. 如果元組中的對象是可變對象,,則可變對象的引用不允許改變,,但數(shù)據(jù)可以改變

元組的遍歷

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

集合

  • Python 語言提供的內(nèi)置數(shù)據(jù)結(jié)構(gòu)
  • 與列表,、字典一樣都屬于可變類型的序列
  • 集合是沒有 value 的字典

集合的創(chuàng)建方式

  • 直接{}
s={ 'Python','hello',90 }
  • 使用內(nèi)置函數(shù) set()
s={ 2,3,4,4,5,5,6,7,7 } #集合中的元素不允許重復(fù)(與字典相同) s=set(range(6)) print(s) print(set([3,4,53,56])) #將列表轉(zhuǎn)換成集合 print(set([3,4,43,435])) #將元組轉(zhuǎn)換成集合,,元素是無序的 print(set('Python')) #將字符串轉(zhuǎn)換為集合,按字母序列,,無序 print(set({124,3,4,4,5})) #集合 print(set()) #空集合

集合元素的判斷操作

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

集合元素的新增操作

  • 調(diào)用 add() 方法,,一次添加一個元素
  • 調(diào)用 update() 方法,至少添加一個元素
s.add(40) #添加一個元素 s.update({60,70,80}) #添加多個元素 # update() 里還可以放元組,、列表

集合元素的刪除操作

  • 調(diào)用 remove() 方法,,一次刪除一個指定元素,如果指定元素不存在則拋出 KeyError
  • 調(diào)用 discard() 方法,,一次刪除一個指定元素,如果指定元素不存在則不會拋出異常
  • 調(diào)用 pop() 方法,,一次刪除一個任意元素
  • 調(diào)用 clear() 方法,,清空集合
s.remove(10)
s.remove(500) #報錯
s.discard(500) #不會報錯
s.pop() #刪除任意元素,,隨機的刪除一個元素,該方法無參數(shù)
s.clear() #清空集合

集合間的關(guān)系

兩個集合是否相等

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

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

  • 可以調(diào)用方法 issubset 判斷
  • B 是 A 的子集
s1={1,2,3}
s2={3,2,1}
s3={1,2,5,6}
print(s2.issubset(s1)) #True
print(s3.issubset(s1)) #False

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

  • 可以調(diào)用方法 issuperset 判斷
  • A 是 B 的超集
print(s1.issuperset(s2)) #True print(s3.issuperset(s2)) #False

兩個集合是否沒有交集

  • 可以調(diào)用方法 isdisjoint 判斷
print(s2.isdisjoint(s3)) #False 有交集為 False
s4={100,200,300}
print(s2.isdisjoint(s4)) #True 沒有交集為 True

集合的數(shù)學(xué)操作

交集 intersection()

s1={1,2,3,4,5} s2={3,4,5,6,7} print( s1.intersection(s2) ) #執(zhí)行結(jié)果為 {3,4,5} #簡寫為 print(s1 & s2)

并集 union()

print(s1.union(s2)) #執(zhí)行結(jié)果為 {1,2,3,4,5,6,7} ,,去掉了重復(fù)的元素
#簡寫為
print(s1 | s2)

差集 difference()

print(s1.difference(s2)) #執(zhí)行結(jié)果為 {1,2} #簡寫為 print(s1-s2)

對稱差集 symmetric_difference()

print(s1.symmetric_difference(s2)) #執(zhí)行結(jié)果為 {1,2,6,7}
#簡寫為
print(s1^s2)

集合生成式

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

總結(jié)列表,、字典、元組,、集合


字符串

字符串的駐留機制

  • 字符串

  • 在 Python 中字符串是基本數(shù)據(jù)類型,,是一個不可變的字符序列

  • 什么叫字符串駐留機制呢?

  • 僅保存一份相同且不可變字符串的方法,,不同的值被存放在字符串的主流池中,,Python 的主流機制對相同的字符串只保留一份拷貝,后續(xù)創(chuàng)建相同字符串時,,不會開辟新空間,,而是把該字符串的地址賦給新創(chuàng)建的變量

  • 駐留機制的集中情況(交互模式)

  1. 字符串的長度為 0 或 1 時
    • 兩個變量要么為空 0,要么字符串一樣時 1
  2. 符合標識符的字符串
    • 例如%不符合標識符,,所以類似 abc% 的字符串創(chuàng)建兩個,,為兩個id地址的字符串,即內(nèi)容一樣地址不一樣
  3. 字符串只在編譯時進行主流,,而非運行時
a='abc'
b='ab' 'c'
c=''.join(['ab','c'])
print(a is b) #True a 和 b 是編譯時創(chuàng)建的,,地址相同
print(a is c) #False c 是運行時計算的,新開辟的內(nèi)存空間
  1. [-5,265] 之間的整數(shù)數(shù)字
a=-5 b=-5 print(a is b) #True 在整數(shù)數(shù)字區(qū)間內(nèi) a=-6 b=-6 print(a is b) #False 不在整數(shù)數(shù)字區(qū)間內(nèi)
  • sys 中的 intern 方法強制2個字符串指向同一個對象
import sys
a='abc%'
a='abc%'
print(a is b) #False 不符合標識符的不駐留

a=sys.intern(b)
print(a is b) #True 強制駐留
  • PyCharm 對字符串進行了優(yōu)化處理

字符串駐留機制的優(yōu)缺點

  • 當需要值相同的字符串時,,可以直接從字符串池中拿來使用,,避免頻繁創(chuàng)建和銷毀,提升效率和節(jié)約內(nèi)存,,因此拼接字符串和修改字符串是回比較影響性能的
  • 在需要進行字符串拼接時建議使用 str 類型的 join 方法,,而非 ,因為 join() 方法是先計算出所有字符中的長度,,然后再拷貝,,只 new 一次對象,效率比 效率高

字符串的查詢操作方法

index()

  • 從左往右查第一個字符串,,如果沒找到則拋錯

rindex()

  • 從右往左查第一個字符串,,如果沒找到則拋錯

find()

  • 從左往右查第一個字符串,如果沒找到則返回 -1

rfind()

  • 從右往左查第一個字符串,,如果沒找到則返回 -1

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

字符串的大小寫轉(zhuǎn)換操作方法

upper()

  • 把字符串中所有字符都轉(zhuǎn)成大寫字母

lower()

  • 把字符串中所有字符都轉(zhuǎn)成小寫字母

swapcase()

  • 把字符串中所有大寫字母轉(zhuǎn)成小寫字母,,把所有小姐字母轉(zhuǎn)成大寫字母
print('Hello,world'.swapcase()) # hELLO,WORLD

capitalize()

  • 把第一個字符轉(zhuǎn)成大寫,把其余字符轉(zhuǎn)成小寫
print('Hello'.capitalize()) # Hello

title()

  • 把每個單詞的第一個字符轉(zhuǎn)成大寫,,把每個單詞的剩余字符轉(zhuǎn)成小寫
print('Hello world'.swapcase()) # Hello World

字符串內(nèi)容對齊操作

center()

ljust()

rjust()

zfill()

  • 右對齊,,使用0進行填充

字符串劈分操作

split()

  • 從字符串左邊開始劈分,默認的劈分字符是空格字符串,,返回的值都是一個列表
  • 以通過參數(shù) sep 指定劈分字符串是的劈分符
  • 通過參數(shù) maxsplit 指定劈分字符串時的最大劈分次數(shù),在經(jīng)過最大次劈分后,,剩余的子串會單獨作為一部分

rsplit()

  • 從字符串右邊開始劈分,默認的劈分字符是空格字符串,,返回的值都是一個列表
  • 以通過參數(shù) sep 指定劈分字符串是的劈分符
  • 通過參數(shù) maxsplit 指定劈分字符串時的最大劈分次數(shù),,在經(jīng)過最大次劈分后,剩余的子串會單獨作為一部分

字符串判斷操作

isidentifier()

  • 判斷指定的字符串是否合法標識符

isspace()

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

isalpha()

  • 判斷指定的字符串是否全部由字母組成

isdecimal()

  • 判斷指定字符串是否全部由十進制的數(shù)字組成

isnumeric()

  • 判斷指定的字符串是否全部由數(shù)字組成

isalnum()

  • 判斷指定字符串是否全部由字母和數(shù)字組成

字符串其他的操作方法

replace()

  • 字符串替換

join()

  • 字符串合并

字符串的比較操作

  • 運算符 > >= < <= == !=


字符串的切片操作

  • 字符串切片后都將產(chǎn)生新的內(nèi)存對象

格式化字符串

name='張三'
age=20
print('我叫%s,,今年%d歲' % (name,age))
print('我叫{0},,今年{1}歲'.format(name,age))
print(f'我叫{name},今年{age}歲')
print('%10d' % 99) # 10表示寬度
print('%.3f' % 3.1415926) # 表示精度,,保留3位小數(shù)
print('{0:.3f}'.format(3.1415926)) #表示精度,,保留3位小數(shù)

print('{0:.3}'.format(3.1415926)) #表示一共是3位數(shù)

print('%10.3f' % 3.1415926) #同時表示寬度、精度
print('{0:10.3f}'.format(3.1415926)) #同時表示寬度,、精度

字符串的編碼轉(zhuǎn)換


函數(shù)

函數(shù)的創(chuàng)建和調(diào)用

  • 函數(shù)就是執(zhí)行特定任何以完成特定功能的一段代碼
  • 為什么需要函數(shù)
    1. 服用代碼
    2. 隱藏實現(xiàn)細節(jié)
    3. 提高可維護性
    4. 提高可讀性便于調(diào)試
#創(chuàng)建函數(shù) def calc(a,b): # 形參,,形式參數(shù) c=a b return c result=calc(10,20) #實參,實參的位置是函數(shù)的調(diào)用處 print(result)

函數(shù)的參數(shù)傳遞

  • 兩種傳遞方式
  • 位置實參:根據(jù)形參對應(yīng)的位置進行實參傳遞
  • 關(guān)鍵字實參:根據(jù)形參名稱進行實參傳遞
#位置實參
def calc(a,b):
calc(10,20)

#關(guān)鍵字實參
def calc(b=20,a=10):
calc(10,20)
  • 參數(shù)傳遞內(nèi)存分析圖

  • 函數(shù)返回多個值時,,結(jié)果為元組

# 1.無返回值的函數(shù),,不用寫 return def fun1(): print('hello') # 2.有1個返回值的函數(shù),返回類型為原類型,,示例中返回的是 str def fun2(): return 'hello' res=fun2() # 3.返回多個值,,返回類型為元組 def fun3(): return 'hello','world' print(fun3()) # 函數(shù)在定義時,是否需要返回值,,視情況而定

函數(shù)的參數(shù)定義

  • 函數(shù)定義默認值參數(shù)
  • 給形參設(shè)置默認值,,只有與默認值不符的情況才需要傳遞實參
def fun(a,b=100):
    print(a,b)

fun(100) # 當沒有給參數(shù) b 傳值時,b 默認值 100
fun(20,30)
  • 個數(shù)可變的位置參數(shù)
  • 定義函數(shù)時,,可能無法實現(xiàn)確定傳遞的位置實參的個數(shù)時,,使用可變的位置參數(shù)
  • 使用 * 定義個數(shù)可變的位置形參
  • 結(jié)果為一個元組
# 定義可變的位置參數(shù) def fun(*args): print(args) # 調(diào)用函數(shù),傳入不同個數(shù)的參數(shù),,輸出的是元組 fun(10) fun(10,30) fun(10,30,50)
  • 個數(shù)可變的關(guān)鍵字形參
  • 定義函數(shù)時,,無法事先確定傳遞的關(guān)鍵字實參的個數(shù)時,使用可變的關(guān)鍵字形參
  • 使用 ** 定義個數(shù)可變的關(guān)鍵字形參
  • 結(jié)果為一個字典

def fun1(**args):
    print(args)

fun1(a=10) # 結(jié)果為字典類型,,{'a':10}
fun1(a=20,b=30,c=40)  # 結(jié)果為字典類型,,{'a:20,'b':30,'c':40}
  • 在函數(shù)定義參數(shù)時,兩種類型的參數(shù)只能各自定義一個
  • 但兩個類型的參數(shù)可以同時出現(xiàn)在一個函數(shù)參數(shù)內(nèi),,但順序是個數(shù)可變的位置參數(shù)定義在前,,個數(shù)可變的關(guān)鍵字形參定義在后
# 第一個參數(shù)為可變的位置參數(shù),第二個參數(shù)為可變的關(guān)鍵字參數(shù) def fun3(*args1,**args2):

函數(shù)的參數(shù)總結(jié)

變量的作用域

定義函數(shù)

  • 局部變量
    • 在函數(shù)內(nèi)定義并使用的變量,,只在函數(shù)內(nèi)部游逍,,局部變量使用 global 聲明,,這個變量就會變成全局變量
  • 全局變量
    • 函數(shù)體外定義的變量,可作用于函數(shù)內(nèi)外
def fun(a,b):   # a , b 為函數(shù)的形參
    c=a b   # c 局部變量
    print(c)

name='楊老師'  # name 全局變量
def fun2():
    print(name)

def fun3():
    global age  # 在函數(shù)體內(nèi)定義的全局變量
    age = 20
    print(age)

fun3()
print(age)  #在外部也可以訪問該變量

遞歸函數(shù)

  • 如果在一個函數(shù)的函數(shù)體內(nèi)調(diào)用了該函數(shù)本身,,這個函數(shù)成為遞歸函數(shù)
  • 遞歸調(diào)用與遞歸終止條件
  • 每遞歸調(diào)用一次函數(shù),,都會在棧內(nèi)存分配一個棧幀
  • 每執(zhí)行完一次函數(shù),,都會釋放響應(yīng)的空間
  • 缺點:占用內(nèi)存多,,效率低下
  • 有點:思路和代碼簡單
def fac(n): if n==1: return 1 else: return n*fac(n-1) print(fac(6))

異常處理

try-except 結(jié)構(gòu)

try:
    a=int(input('請輸入第一個整數(shù):'))
    b=int(input('請輸入第二個整數(shù):'))
    result=a/b
    print('結(jié)果為:',result)
except ZeroDivisionError:   #捕獲為零的異常
    print('除數(shù)不允許為0')
except ValueError:  #捕獲值類型異常
    print('請輸入數(shù)字')
except BaseException as e:   # 最后寫上這個可以捕獲遺漏的、其他的異常
    print('捕獲其他異常錯誤',e)
print('程序結(jié)束')

try-except-else 結(jié)構(gòu)

try: a=int(input('請輸入第一個整數(shù):')) b=int(input('請輸入第二個整數(shù):')) result=a/b except ZeroDivisionError: #捕獲為零的異常 print('除數(shù)不允許為0') except ValueError: #捕獲值類型異常 print('請輸入數(shù)字') except BaseException as e: # 最后寫上這個可以捕獲遺漏的,、其他的異常 print('捕獲其他異常錯誤',e) else: print('結(jié)果為:',result) print('程序結(jié)束')

try-except-else-finally 結(jié)構(gòu)

try:
    a=int(input('請輸入第一個整數(shù):'))
    b=int(input('請輸入第二個整數(shù):'))
    result=a/b
except ZeroDivisionError:   #捕獲為零的異常
    print('除數(shù)不允許為0')
except ValueError:  #捕獲值類型異常
    print('請輸入數(shù)字')
except BaseException as e:   # 最后寫上這個可以捕獲遺漏的,、其他的異常
    print('捕獲其他異常錯誤',e)
else:
    print('結(jié)果為:',result)
finally:
    print('程序結(jié)束') #無論 except 還是 else 都會執(zhí)行到這里

Python 常見的異常類型

traceback 模塊打印異常信息

  • 獲取異常信息,用于后續(xù)對異常的記錄log日志之類的操作

調(diào)試

  • 斷點
  • 程序運行到此處,,暫時掛起,,停止執(zhí)行。此事可以詳細觀察程序的運行情況,,方便做出進一步的判斷
  • 進入調(diào)試視圖
  • 三種方式:
  • 單擊工具欄的按鈕
  • 右鍵單擊編輯區(qū)
  • 快捷鍵:shift F9
  • 以上內(nèi)部根據(jù)不同的編譯器可能會不同

編程思想

  • 編程屆的兩大陣營

類與對象

  • 數(shù)據(jù)類型

  • 對象

  • 100,、99、520 都是 int 類之下包含的相似的不同個例,,這個個例專業(yè)數(shù)據(jù)稱為實例或?qū)ο?/p>

  • 一切皆對象

創(chuàng)建類

  • 類的組成
    1. 屬性
    2. 實例方法 self
    3. 靜態(tài)方法
    4. 類方法 cls
class Student: #類 native_pace='廣州' #寫在類里的變量,,稱為類屬性 #初始化方法 def __init__(self,name,age): self.name=name #self.name 稱為實體屬性,進行了一個復(fù)制的操作,,將局部變量的 name 的值賦給實體屬性 self.age=age #實例方法 def eat(self): #實例方法的參數(shù)中,,必須寫上 self ,哪怕不寫它也會默認 print('學(xué)生在吃飯,。') #靜態(tài)方法 @staticmethod def method(): #靜態(tài)方法的參數(shù)不允許寫 self ,,這是規(guī)定 print('我使用了 staticmethod 進行了修飾,所以我是靜態(tài)方法') #類方法 @classmethod def cm(cls): #類方法括號中必須帶 cls ,,這是規(guī)定 print('我是類方法,,因為我使用了 classmethod 進行修飾')
  • 在類外面定義的稱之為函數(shù),在類定義的稱為方法

類的實例化

  • 意義:有了實例,,就可以調(diào)用類中的內(nèi)容
#創(chuàng)建 Student 類的實例對象 stul
stul=Student('張三',20)
stul.eat() #使用類的方法
print(stul.name,stul.age) #獲取類的屬性
#第二種調(diào)用方法:類名.方法名(類的實例對象),,實際上就是方法定義處的self
Student.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) #返回 天津 #類屬性共享,,供多個實例化訪問相同的內(nèi)存地址

類方法

  • 使用 @classmethod 修飾的方法,使用雷鳴直接訪問的方法
Student.cm()

靜態(tài)方法

  • 使用 @staticmethod 修飾的方法,,使用類名直接訪問的方法
Student.method()

動態(tài)綁定屬性和方法

  • Python 是動態(tài)語言,,在創(chuàng)建對象后,可以動態(tài)綁定屬性和方法
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)

#為實例對象 動態(tài)創(chuàng)建屬性 stu2.gender='女' #該屬性值隸屬于實例對象 stu2 的 print(stu1.name,stu1.age) #輸出 張三 20 print(stu2.name,stu2.age,stu2.gender) #輸出 李四 30 女
  • 動態(tài)綁定方法
#類之外創(chuàng)建一個函數(shù)
def show():
    print('定義在類之外的,,稱函數(shù)')
#綁定到實例對象 stu1 的 show 方法
stu1.show=show
stu1.show()

封裝

提高程序的安全性

  • 將數(shù)據(jù)(屬性)和行為(方法)包裝到類對象中。在方法內(nèi)部對屬性進行操作,在類對象的外部調(diào)用方法,。這樣,,無序關(guān)心方法內(nèi)部的具體實現(xiàn)細節(jié),從而隔離了復(fù)雜度,。
  • 在 Python 中沒有專門的修飾符用于屬性的私有,,如果該屬性不希望在類對象外被訪問,前面使用兩個“_”
#創(chuàng)建類 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() #輸出 張三 20 print(stu.name) #輸出 張三 print(stu.__age) #程序拋錯,,提示屬性錯誤,該屬性為類的私有屬性,,外部不允許使用 print(stu._Student__age) #在類的外部可以通過 _Student__age 進行訪問
  • 提示:作為程序員,,強烈建議不采取這種方式訪問 _Student__age

繼承

  • 提高代碼的復(fù)用性
  • 語法格式
  • class 子類類名( 父類1 , 父類2... )
  • pass
  • 如果一個類沒有繼承任何基類,則默認繼承 object
  • Python支持多繼承
  • 定義子類時,,必須在其構(gòu)造函數(shù)中調(diào)用父類的構(gòu)造函數(shù)
#多繼承
class A(object):
    pass

class B(object):
    pass

#C類繼承了A,、B兩個類
class C(A,B):
    pass

方法重寫

  • 如果子類對繼承自父類的某個屬性或方法不滿意,可以在子類中對其(方法體)進行重新編寫
  • 子類重寫后的方法中可以通過 super().xxx() 調(diào)用父類中被重寫的方法

object類

  • object 類是所有類的父類,,所有類都有 object 類的屬性和方法
  • 內(nèi)置函數(shù) dir() 可以查看指定對象所有屬性
  • Object 有一個 str() 方法,,用于返回一個對于“對象的描述”,,對應(yīng)于內(nèi)置函數(shù) str() 經(jīng)常用于 print() 方法,幫我們查看對象的信息,,所有我們經(jīng)常會對 str() 進行重寫

多太

提高程序的可擴展性和可維護性

  • 即便不知道一個變量所引用的對象到底是什么類型,,仍然可以通過這個變量調(diào)用方法,在運行過程中根據(jù)變量所引用對象的類型,動態(tài)決定調(diào)用哪個對象中的方法

特殊方法和特殊屬性

變量賦值操作

  • 只是形成兩個變量,,實際上還是指向同一個對象
class CPU: pass class Disk: pass class Computer: def __init__(self,cpu,disk): self.cpu=cpu self.disk=disk #實例CPU的類實例 cpu1=CPU() #將實例對象 cpu1 賦值給 cpu2 cpu2=cpu1 #輸出兩個對象的內(nèi)存地址是一樣的 print(cpu1,cpu2) #總結(jié),變量賦值,,實際上還是指向同一個對象

淺拷貝

  • Python 拷貝一版都是淺拷貝,,拷貝時,對象包含的子對象不拷貝,,因此,源對象與拷貝對象會引用同一個子對象
class CPU:
    pass

class Disk:
    pass

class Computer:
    def __init__(self,cpu,disk):
        self.cpu=cpu
        self.disk=disk
 
 cpu1=CPU()
 disk1=Disk()
 computer1=Computer(cup1,disk1) #創(chuàng)建計算機的實例對象
 
 #淺拷貝
 import copy
 computer2=copy.copy(computer1)
 
 #輸出類對象的內(nèi)存地址,,及子類對象的地址
 print(computer1,computer1.cpu,computer1.disk)
 print(computer2,computer2.cpu,computer2.disk)

# 結(jié)論:computer類的兩個實例化對象的內(nèi)存地址不同,,但兩個 cpu 和 disk 子類實例對象的內(nèi)存地址一樣

深拷貝

  • 使用 copy 模塊的 deepcopy 函數(shù),遞歸拷貝對象中的子對象,源對象和拷貝對象所有的子對象也不相同
#深拷貝 computer3=copy.deepcopy(computre1) print(computer1,computer1.cpu,computer1.disk) print(computer2,computer2.cpu,computer2.disk) # 結(jié)論:computer類與兩個 cpu 和 disk 子類實例對象的內(nèi)存地址都不一樣

模塊

什么是模塊

  • 模塊的英文名稱:Modules
  • 函數(shù)與模塊的關(guān)系:一個模塊中包含多個函數(shù)
  • 在 Python 中一個模塊的文件擴展名為 .py
  • 使用模塊的好處:
    1. 方便其他程序和腳本的導(dǎo)入并使用
    2. 避免函數(shù)名和變量名沖突
    3. 提高代碼的可維護性
    4. 提高代碼的可重用性

自定義模塊

  • 新建一個 .py 文件,,名稱不要與 Python 自帶的標準模塊名稱相同

導(dǎo)入模塊

  • import 模塊名稱 [as 別名]
  • from 模塊名稱 import 函數(shù)/變量/類
#1.引入模塊名稱
import math #引入一個數(shù)學(xué)運算的模塊
print(math.pi)  #調(diào)用 math 模塊中的 pi 函數(shù),輸出一個π的數(shù)值,顯示:3.1415926
print(dir(math)) #查詢 math 模塊中的所有可操作的函數(shù)或方法

#2.引入某個模塊中的函數(shù),、變量或類
from math import pi
from math import pow

print(pi)
print(pow(2,3))

以主程序形式運行

  • 在每個模塊的定義中都包括一個記錄模塊名稱的變量 __name__,,程序可以檢查該變量,以確定他們在哪個模塊中執(zhí)行,。如果一個模塊不是被導(dǎo)入到其他模塊中執(zhí)行,那么它可能在解釋器的頂級模塊中執(zhí)行。頂級模塊的 __name__ 變量的值為 __main__
# 創(chuàng)建文件 calc.py 文件 def add(a,b): return a b if __name__ = '__main__': print(add(10,20)) #1.當其他文件調(diào)用了 calc.py 文件,,print 不會被執(zhí)行 #2.當 calc.py 文件本身被執(zhí)行,,print 會執(zhí)行輸出,因為 calc.py 文件被主動執(zhí)行時,,__name__ 會被標記為當前程序 __main__

  • 包是一個分層次的目錄結(jié)構(gòu),,它將一組功能相近的模塊組織在一個目錄下

  • 作用:

    1. 代碼規(guī)范
    2. 避免模塊名稱沖突
  • 包與目錄的區(qū)別

    1. 包:含 __init__.py 文件的目錄稱為包,一個包可以包含多個模塊
    2. 目錄:里不包含 __init__.py 文件
  • 包的導(dǎo)入
    import 包名.模塊名

#導(dǎo)入包中的模塊 import 包名.模塊名 as 別名
import pageage1.mouduleA as ma

#調(diào)用該模塊里的函數(shù)
print(ma.a)

Python 中常用的內(nèi)置模塊

第三方模塊的安裝及使用

  • 安裝第三方模塊
pip install 模塊名
  • 在線安裝

  • 使用第三方模塊

import 模塊名

知識總結(jié)

文件目錄

編碼格式

  • Python 解釋器使用的是 Unicode(內(nèi)存)
  • .py 文件在磁盤上使用 UTF-8 存儲(外存)

文件讀寫原理

  • 文件讀寫俗稱“IO操作”
    -內(nèi)置函數(shù) open() 創(chuàng)建文件對象
  • 語法規(guī)則
#創(chuàng)建文件對象 file1=open('a.txt','r') #讀取一個文件,,模式為:只讀 #輸出文件內(nèi)容 print(file1.readlines()) # readlines() 讀取的是一個“列表” #關(guān)閉系統(tǒng)資源 file1.close()

文件讀寫操作

  • 文件的類型
  • 按文件中的數(shù)據(jù)組織形式,,文件分為兩大類型:
    1. 文本文件:存儲普通“字符”文本,默認為 Unicode 字符集,,可以使用記事本程序打開
    2. 二進制文件:把數(shù)據(jù)內(nèi)容用“字節(jié)”存儲,,無法用記事本打開,必須使用專用軟件打開,,例:mp3音頻文件,、png圖片文件、doc文檔 等
#創(chuàng)建寫入的文件對象
# w 寫入,,覆蓋原文件
# a 寫入,,在原文件內(nèi)容后追加內(nèi)容
file2=open('b.txt','w') #模式為:寫

#寫入信息
file2.write('hello world')  #如果文件存在,則寫入操作會覆蓋原文件
#關(guān)閉系統(tǒng)資源
file2.close()

#對二進制文件的讀寫操作
src_file=open('logo.png','rb')  #創(chuàng)建只讀的圖像文件對象
target_file=open('copylogo.png','rb')   #創(chuàng)建只寫的圖像文件對象

#讀取 src_file 文件對象,,并寫入到 target_file 文件對象中
target_file.write(src_file.read())

#關(guān)閉系統(tǒng)資源
target_file.close()
src_file.close()

#最后,,  號表示以讀寫的方式打開,需要與其他模式一起使用,,例:a 

文件對象常用方法

with語句(上下文管理器)

  • with 語句可以自動管理上下文資源,不論什么原因跳出 with 塊,,都能確保文件正確關(guān)閉,,以此來達到釋放資源的目的
with open('a.txt','r') as file1: print(file1.read()) #語句最后 with 會自動關(guān)閉釋放,而不需要人為寫關(guān)閉語句 #完整的賦值粘貼一張圖片的代碼就是三行 with open('logo.png','rb') as src_file: with open('copy2logo.png','wb') as target_file: target_file.write(src_file.read())

目錄操作

  • OS 模塊是 Python 內(nèi)置的與操作系統(tǒng)功能和文件系統(tǒng)相關(guān)的模塊,,該模塊中的語句執(zhí)行結(jié)果通常與操作系統(tǒng)有關(guān),,在不同的操作系統(tǒng)上運行,得到的結(jié)果可能不一樣
  • OS 模塊與 OS.path 模塊用于對目錄或文件進行操作
#打開操作系統(tǒng)的記事本
import os
os.system('notepad.exe')

#調(diào)用系統(tǒng)中的可執(zhí)行文件,,例如打開QQ
os.startfile('C:\\Program Files (x86)\\Tencent\\QQ\\Bin\\QQ.exe')
  • OS 模塊操作目錄相關(guān)函數(shù)

  • OS.path 模塊操作目錄相關(guān)函數(shù)

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

知識總結(jié)

其他知識

項目打包

  • 安裝第三方模塊
  • 在線安裝方式
  • 語法:pip install PyInstaller
  • 執(zhí)行打包操作
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

    本站是提供個人知識管理的網(wǎng)絡(luò)存儲空間,,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點,。請注意甄別內(nèi)容中的聯(lián)系方式,、誘導(dǎo)購買等信息,謹防詐騙,。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,,請點擊一鍵舉報,。
    轉(zhuǎn)藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多