So, let's say I have this structure:
list_test = [["A", "1", "Test"], ["B", "2", "Test2"], ["C", "3", "Test"]]
my desired output is:
[["A", "1", "Test"], ["A", "1", "Test"], ["A", "1", "Test"], ["B", "2", "Test2"], ["B", "2", "Test2"], ["B", "2", "Test2"], ["C", "3", "Test"], ["C", "3", "Test"], ["C", "3", "Test"]]
So I'm multiplying 3 times each list. I'm able to do it with extend and other ways of iteration with no issues, but I'm trying to learn solving it using list comprehensions.
I thought about something like this: [i * 4 for i in list_test]
but that copies the list inside of itself, like this:
[['A', '1', 'Test', 'A', '1', 'Test', 'A', '1', 'Test'], ['B', '2', 'Test2', 'B', '2', 'Test2', 'B', '2', 'Test2'], ['C', '3', 'Test', 'C', '3', 'Test', 'C', '3', 'Test']]
[[i] * 4 for i in list_test]
does something similar to what I want but it's inside another list, that's not what I want it.
Is it possible to solve this using comprehension?