2024年8月1日
摘要: test = 'alex'v = test[2] # 索引,下标,获取字符串中的某一个字符print(v, -1)test = 'alexsasdf'v = test[0:3] # 0=<v<3print(v, -2)v1 = test[0:-1] # 切片print(v1, -3)v2 = len 阅读全文
posted @ 2024-08-01 17:41 柳志军 阅读(3) 评论(0) 推荐(0) 编辑