I want to append the lists "b", "c" and "d" to my list "a". Then i want to print the single lists in each line. My expected output is:
[(4, 'Blue'), (3, 'Red'), (4, 'Red')]
[(2, 'Green'), (4, 'Green'), (1, 'Yellow')]
[(1, 'Green'), (3, 'Blue'), (3, 'Green')]
[(2, 'Blue'), (1, 'Red'), (4, 'Yellow')]
My current code is:
a = [(4, 'Blue'), (3, 'Red'), (4, 'Red')]
b = [(2, 'Green'), (4, 'Green'), (1, 'Yellow')]
c = [(1, 'Green'), (3, 'Blue'), (3, 'Green')]
d = [(2, 'Blue'), (1, 'Red'), (4, 'Yellow')]
a.append(b)
a.append(c)
a.append(d)
for x in a:
print(x)
My current output is:
(4, 'Blue')
(3, 'Red')
(4, 'Red')
[(2, 'Green'), (4, 'Green'), (1, 'Yellow')]
[(1, 'Green'), (3, 'Blue'), (3, 'Green')]
[(2, 'Blue'), (1, 'Red'), (4, 'Yellow')]
As you see the first 3 lines of output are separated and not together. How can I change this so that it appears according to my expected output?