Sequence types like range objects do not support concatenation and repetition. Furthermore, Python containers that are non-sequence data types (such as sets or dictionaries) do not support concatenation and repetition operators. In this article, we will take a detailed look at concatenations and repetitions that are supported by sequence data types such as list, tuple, and strings.

Example Using + operator results in and addition to int objects and concatenation in strings.Example If the strings are placed next to each other without + operator this will result in a concatenation.Example Apply methods to strings while concatenating.

The concatenation and repetition operators are supported only by sequence datatypes except for when a range object is present.

Related Articles