Why are the dcount and tcount 0 and 0 in the output?
a = [1, 2, 3, 4]
dcount = 0
tcount = 0
def doubles():
dcount = 0
for i in a:
for j in a:
if (i+j)%3 == 0:
dcount += 1
print(i,j)
def triplets():
tcount = 0
for i in a:
for j in a:
for k in a:
if (i+j+k)%3 == 0:
tcount += 1
print(i,j,k)
doubles()
triplets()
print(dcount)
print(tcount)
4 1 4
4 2 3
4 3 2
4 4 1
4 4 4
0
0
[Finished in 0.1s]