I have tried this
list1=[100,1010,1001,1111,10100]
print(list1.count(00))
I got this
0
Expected Output:
3
I have tried this
list1=[100,1010,1001,1111,10100]
print(list1.count(00))
I got this
0
Expected Output:
3
Did you try:
list1 = [100,1010,1001,1111,10100]
print("".join(str(x) for x in list1).count("00"))
Prints: 3
list.count(00) will only give you the number of occurrences of the value '00' in the list.
To look for the characters 00 within each list item you will need to iterate through the list and look at each item.
Easiest check would be to convert the value to a string and then check for the double 00 characters within that
IIUC, you could filter and count:
count = sum(1 for e in list1 if '00' in str(e))
output: 3
Or, if a number like 10000 should count for 2 occurrences of 00:
count = sum(str(e).count('00') for e in list1)