The problem asks me to count the size of holes in the text exp: A, D, R, O, P has only one hole, and B has two I made the following code:
qnt = int(input())
cont = 0
l = []
for i in range(qnt):
txt = input()
dic = {'A':1, 'D':1, 'O':1, 'P':1, 'R':1, 'B':2}
for i in txt:
if dic.get(i, 0):
cont += dic[i]
print(cont)
However, only the number of holes in the last text appears, and I need each text.