- 博客(2)
- 收藏
- 关注
原创 Python—计算元素出现的个数
计算元素出现的个数 ids=['a','a','d','d','t'] print(ids.count('a')) 2
2021-03-18 01:26:19
674
原创 Python—删除相同元素
删除数组中相同元素 一 #不保留顺序 ids=['a','a','d','d','t'] # ids=[1,2,3,2,1,3,4,1,3,6] ids=list(set(ids)) print(ids) ['d', 't', 'a'] 二 # wordlist=['a','a','d','d','t'] # newList=[] # for n in wordlist: # if n not in newList: # newList.append(n) # print(new
2021-03-18 01:18:03
308
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人