返回值 5 在元组中出现的次数:
thistuple = (1, 3, 7, 8, 7, 5, 4, 6, 8, 5)x = thistuple.count(5)print(x)
thistuple = (1, 3, 7, 8, 7, 5, 4, 6, 8, 5)
x = thistuple.count(5)
print(x)
count() 方法返回指定值在元组中出现的次数。
count()
tuple.count(value)