s = "This is a test string"
1.索引
s[0] = T
s[1] = h
2.长度
len(s) =>21
3.切片
s[0:2] =>Th
4.循环(continue 和 break)
for item in s: if item==‘h‘: continue print(item)
s = "This is a test string"
1.索引
s[0] = T
s[1] = h
2.长度
len(s) =>21
3.切片
s[0:2] =>Th
4.循环(continue 和 break)
for item in s: if item==‘h‘: continue print(item)
原文:https://www.cnblogs.com/pipi-vincent/p/8329602.html