I am using a loop to create tuples, and I would like to insert these tuples into a big tuple.
Assuming my input is (1, 2, 3), which is generated from every loop, my expected output is ((1, 2, 3), (1, 2, 3)).
I tried multiple ways but still cannot figure out how to do it.
big_tup = ()
for i in range(2):
tup = (1, 2, 3)
# this will cause AttributeError: 'tuple' object has no attribute 'insert'
big_tup.insert(tup)
# this will combine all tuples together, output: (1, 2, 3, 1, 2, 3)
big_tup += tup
# this will make duplicates of (), output: (((), 1, 2, 3), 1, 2, 3)
big_tup = (big_tup,) + tup
I would be very appreciated if anyone can help me solve this. Thanks in advance!