How do I duplicate the elements in a list? Without returning any value or even changing the order of the list?
for example I have defined a function with an argument:
def func1(list1):
- func1 is supposed to modify list1 so that each element appears twice without changing the order of the list itself
like this:
In: list1 = [342, 548, 23, 321, 555]
In: func1(list1)
In: list1
Out: [342, 548, 23, 321, 555, 342, 548, 23, 321, 555]
And thank you so much in advance!