摘要:
List相关操作小例子 (目录) 获取list的下标和值 >>> mylist = ['a', 'b', 'c', 'd'] >>> for index, value in enumerate(mylist): ... print(index, value) ... 0 a 1 b 2 c 3 d 阅读全文
摘要:
本文记录一些Python字符串相关操作。 (目录) 判断字符串中是否包含指定字符串 1、in 操作符 text = "hello world!" result = 'world' in text 2、index方法 >>> text = "hello world!" >>> text.index(' 阅读全文