【发布时间】:2021-09-09 11:47:52
【问题描述】:
我有给定的列表,我想通过使用集合中的计数器来访问我在列表中获得值“6”的次数:
list1=[3,4,6,4,5,6,2,3,6,7,6]
print("the number of time 6 occurred is ")
print(s6) #s6 is the variable to hold the number of time 6 occurred in the list.
【问题讨论】:
标签: python python-3.x list collections counter