摘要: 1.字符串 字符串取值 字符串取值:字符串[索引值]#索引:从0开始标记#取!号s = ' hello!'s1 = s[5]s2 = s[-1] 字符串取多个值:切片 字符串名[索引头:索引尾:步长]步长默认为1print(s[1:5:1])#取头不取尾print(s[:])#2print(s[:4 阅读全文
posted @ 2022-04-13 11:43 takoua 阅读(106) 评论(0) 推荐(0)