摘要: 阅读全文
posted @ 2020-05-29 17:04 "懒木鱼" 阅读(74) 评论(0) 推荐(0)
摘要: >>> x = [1, 2, 3]>>> y = [4, 5, 6]>>> z = [7, 8, 9]>>> xyz = list(zip(x, y, z))>>> unxyz=zip(*xyz)>>> print(xyz)[(1, 4, 7), (2, 5, 8), (3, 6, 9)]>>> p 阅读全文
posted @ 2020-05-29 16:44 "懒木鱼" 阅读(133) 评论(0) 推荐(0)
摘要: 如果找不到目标元素,index会报错,find会返回-1 >>> s="hello world">>> s.find("llo")2>>> s.index("llo")2>>> s.index("llos")Traceback (most recent call last): File "<stdi 阅读全文
posted @ 2020-05-29 16:42 "懒木鱼" 阅读(123) 评论(0) 推荐(0)