鹹魚祖師🌈
3 years ago @Edit 3 years ago
#自學
Python3: STAT 507 slides 01-02
鹹魚祖師🌈
3 years ago @Edit 3 years ago
#紀錄
input()
import math
return
if x > 0:
print('x is bigger than 0.')
pass
elif is short for else if
break
/ escape character
/n 換行
鹹魚祖師🌈
3 years ago @Edit 3 years ago
len()
"PYTHON"[0] 提取P
"PYTHON"[0:3] 提取PYT
"PYTHOH"[0:5:2] 提取PTO
"python".capitalize() Python
"Hail Python".split() "Hail" "Python"
" ".join(["Hail", "Python"]) "Hail Python"
"Kail Python".replace("K", "H") "Hail Python"
% ex. f, .1f, i, s
.format()
fstring
鹹魚祖師🌈
3 years ago @Edit 3 years ago
import random
random.randint()
立即下載