For example, say a list L = [0,1,2,3], and I want to add 10 items from 4:
L = [0,1,2,3]
L=[0,1,2,3,4,4,4,4,4,4,4,4,4,4]
without using a loop or anything
This is quite simple due to the fact that you can add and / or multiply lists:
L += [4] * 10
Here is the proof:
>>> L = [0,1,2,3] >>> L += [4] * 10 >>> L [0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4]
L.extend([4] * 10) L.extend([some_mutable_object for x in range(10)])