1apple = ('fruit', 'apple')
2banana = ('fruit', 'banana')
3dog = ('animal', 'dog')
4# Make a list with these tuples
5some_list = [apple, banana, dog]
6# Check if it's actually a tuple list
7print(some_list)
8# Make a tuple to add to list
9new_thing = ('animal', 'cat')
10# Append it to the list
11some_list.append(new_thing)
12# Print it out to see if it worked
13print(some_list)
1a_list = []
2a_list.append((1, 2)) # Succeed! Tuple (1, 2) is appended to a_list
3a_list.append(tuple(3, 4)) # Error message: ValueError: expecting Array or iterable
4
1# METHOD 1:
2tapel = (1,2,3,4)
3tapel.__add__((5,6,7,8)) # -> (1,2,3,4,5,6,7,8)
4
5# METHOD 2:
6tapel = list((1,2,3,4))
7tapel.append((5,6,7,8))
8tapel = tuple(tapel) # -> (1,2,3,4,(5,6,7,8))