Python 元組方法
返回值 5 在元組中出現的次數:
thistuple = (1, 3, 7, 8, 7, 5, 4, 6, 8, 5) x = thistuple.count(5) print(x)
運行實例
count() 方法返回指定值在元組中出現的次數。
tuple.count(value)