Python Sequences - Part 2
This post is a continuation of Python Sequences.
Concatenating Sequences
You can concatenate sequences using the plus (+) operator:
1
2
>>> [1, 2] + [3, 4]
[1, 2, 3, 4]
Multiplying Sequences
You can multiply a sequence by an integer number to repeat it the specified number of times:
1
2
>>> [1, 2] * 3
[1, 2, 1, 2, 1, 2]