这是我所知道的,不知道我是否正确地做。
L = [4, 10, 4, 2, 9, 5, 4 ]
n = len(L)
element = ()
if element in L:
print(element)
print("number occurs in list at the following position, if element not in list")
print("this number does not occur in the list")
如何获取多次出现的元素以打印为
4 occurs in L at the following positions: [0, 2, 6]