Hanging during execution

Why would this python code hang during execution?

 import rhinoscriptsyntax as rs
 from itertools import combinations, product
 f= []
 a = [1 for _ in range(12)]
 b = [2 for _ in range(12)]
 c = [3 for _ in range(12)]
 t = a + b + c
 for _ in range(4):
       for i in combinations(t,1):
           f.append(i)
       for i in product(t,repeat =2):
           f.append(i)
 for _ in range(8):
       for i in product(t,repeat=3):
           f.append(i)
       for i in product(t,repeat = 4):
           f.append(i)
       for i in product(t,repeat =5):
           f.append(i)

Because you’re trying to populate your list with an enormous number of elements: 497544912, Four hundred ninety-seven million five hundred forty-four thousand nine hundred twelve.

from itertools import combinations, product
f= []
t = [1] * 12 + [2] * 12 + [3] * 12
for _ in range(4):
    for i in combinations(t, 1): 
        f.append(i) #4 * 36 = 144
    for i in product(t, repeat = 2):
        f.append(i) #4 * 1296 = 5184
for _ in range(8):
    for i in product(t, repeat = 3):
        f.append(i) #8 * 46656 = 373248
    for i in product(t, repeat = 4):
        f.append(i) #8 * 1679616 = 13436928
    for i in product(t, repeat = 5):
        f.append(i) #8 * 60466176 = 483729408