Please enable JavaScript.
Coggle requires JavaScript to display documents.
Python 基礎 (基本應用 (函數 (定義方式, 返回值, 變數作用域, 異常處理), 轉型 (str(), int(), float()),…
Python 基礎
基本應用
轉型
str()
int()
float()
print()
input()
range()
函數
定義方式
返回值
變數作用域
異常處理
module
random
random()
列表
copy
copy.deepcopy()
copy.copy()
字符串
pyperclip
paste()
copy()
正則表達式
re
re.compile()
search
資料結構
字串處理
基本
引號
雙引號
三引號
多行字符串
單引號
轉意符
\
in & not in
len()
方法
大小寫
islower(),isupper()
lower(),upper()
isX
isalpha()
isalnum()
isdecmal()
isspace()
istitle()
端點字串判斷
startwith(),endwith()
字串切割+組合
split(),join()
對齊
rjust(),ljust(),center()
刪除空白
rstrip(),lstrip(),strip
列表
list
刪
del
remove
("a")
查
切片
下標
index
len
(list)
in & not in
index
("a")
由值查index
sort
()
改
#
利用下標
增
[ ]
append
("a")
insert
(posion,"a")
tuple
增
( )
刪
查
改
轉型
list(),tuple()
Key-value pare(字典])
增
{ }
查
key()
value()
items()
get()
判斷是否有某個key值,有的話返回其value
改
setdefault()
判斷是否有某個key值,沒有的話設定其default value
刪
系統
sys.exit()
終止程序