import sys
a = int(sys.argv[1])
def count_holes(n):
dic = {'1':0, '2':0, '3':0, '4':1, '5':0, '6':1, '7':0, '8':2, '9':1}
l = str(n)
counter = 0
i = 1
for i in l:
while i != len(l):
counter = counter + dic[l[i]]
print(counter)
count_holes(a)
i got this: counter = counter + dic[l[i]] TypeError: string indices must be integers