Python - create a list from a list repeated N times


Python tip:

You can create a new list with elements from the first list that are repeated as many times as you want by multiplying.

Fo example:

users = ["johndoe", "marry", "bob"]
print(3 * users)
# => ['johndoe', 'marry', 'bob', 'johndoe', 'marry', 'bob', 'johndoe', 'marry', 'bob']