[bbone=python3,496]tc = int(input())
while tc > 0:
a = input()
b = []
b = a.split()
x = -1
c = 0
m = 0
for i in b:
if x == len(i):
c = c + 1
else:
x = len(i)
if c > m:
m = c
c = 1
if c > m:
m = c
if len(b) != 0:
print(m)
tc = tc - 1[/bbone]
You should think about the conditions for resetting your counter. The testcase still "works" if you extend it a little.