This is how I would go about it.
import random
CCC=0
XXX=0
for count in range (100) :
llista = [random.randint (0, 2) for x in range (3)]
if llista == [0, 0, 0] :
CCC += 1
if llista == [1, 1, 1]:
XXX += 1
print (f'CCC equals {CCC}.')
print (f'XXX equals {XXX}.')
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…