Analysing Python Code

PLEASE CLARIFY WHAT IS THE ERROR IN THIS CODE (PROBLEM CODE-BALLOON)
t=int(input())
for i in range(t):
n=int(input())
l=list(map(int,input().split()))
c=0
for j in range(0,n):
if ((l[j]<=7 and l[j]>=1) or j<=6):
c+=1
print(c)