NZEC error in python input

def boycount1(s1):
substring = “y”
count1 = s.count(substring)
return count1
def girlcount2(s1):
substring = “x”
count2 = s.count(substring)
return count2
t=int(input())
l=[]
m=[]
for i in range(0,t):
s=input()
l.append(s)
for s in l:
m.append(min(boycount1(s),girlcount2(s)))
print(*m,sep="\n")

i have tried using all solutions but still it shows nzec error . kindly someone help me -

try:
def boycount1(s1):
substring = ‘y’
count1 = s1.count(substring)
return count1

def girlcount2(s1):
    substring = 'x'
    count2 = s1.count(substring)
    return count2
t = int(input())
l = []
m = []
for i in range(0, t):
     s = input()
     l.append(s)
for s in l:
     m.append(min(boycount1(s), girlcount2(s)))
print(*m, sep="\n")

except:
pass

this will remove run time error !! but ur logic is wrong