Suppose I have a given Object (a string \"a\", a number - let\'s say 0, or a list [\'x\',\'y\'] )
[\'x\',\'y\']
I\'d like to create list containing many copies of thi
In case you want to create a list with repeating elements inserted among others, tuple unpacking comes in handy:
list
l = ['a', *(5*['b']), 'c'] l Out[100]: ['a', 'b', 'b', 'b', 'b', 'b', 'c']
[the docs]