#D:\Python32
import string
t=1
st=‘fd’
t=input()
while(int(t) > 0):
st=input()
ctr=0
i=0
l=len(st)
for i in range(0,l):
if st[i]==‘A’ or st[i]==‘D’ or st[i]==‘P’ or st[i]==‘O’ or st[i]==‘Q’ or st[i]==‘R’:
ctr=ctr+1
elif st[i]==‘B’:
ctr=ctr+2
print(ctr)
why if the above code showing nzec while running for Holes in the text
This is python 2.7 i presume. The main error is you are using input() for taking string as input but input expects an integer argument. replace input() with raw_input() when you take string input. also i think you have forgotten to decrement t in your while loop!! rest all looks fine