摘要:
# 去掉arr2中 arr2与arr1重复的元素 arr1 = ['a','b','c'] arr2 = ['a','e','f'] for item in arr2: if item in arr1: arr2.remove(item) print(arr2)# 结果:['e','f'] 阅读全文
posted @ 2020-03-04 17:30
古兴越
阅读(464)
评论(0)
推荐(0)
摘要:
# 数组的移除 arr = ['a','b','c'] arr.remove('b') print(arr) arr = ['a','b','c'] for item in arr: if item=='b': arr.remove('b') print(arr) 阅读全文
posted @ 2020-03-04 17:23
古兴越
阅读(1659)
评论(0)
推荐(0)
摘要:
list1 = [1,2,3,4,5,6,7,8] # 格式: a[start:stop:step] # start:开始(包含) # stop:结束(不包含该索引) # step:步长(间隔数量) # 实际的意思是: # 取列表的索引 索引>=2 && 索引<=3 挨着的一串列表 # (索引>=2 阅读全文
posted @ 2020-03-04 17:08
古兴越
阅读(11276)
评论(0)
推荐(0)
摘要:
#原文:https://www.cnblogs.com/shiluoliming/p/9075693.html # 数组的拼接 c1 = ["Red","Green","Blue"] c2 = ["Orange","Yellow","Indigo"] c1.extend(c2) print(c1) 阅读全文
posted @ 2020-03-04 17:06
古兴越
阅读(9790)
评论(0)
推荐(0)
摘要:
arr = ['a','b','c'] for each in arr: print(each) #https://blog.csdn.net/q54244125/article/details/89294895 list = ["a", "b", "c", "d", "e"] for index, 阅读全文
posted @ 2020-03-04 17:05
古兴越
阅读(4548)
评论(0)
推荐(0)
摘要:
# 数组的追加 a = ['a','b','c'] a.append('d') print(a) 阅读全文
posted @ 2020-03-04 17:04
古兴越
阅读(4648)
评论(0)
推荐(0)

浙公网安备 33010602011771号