Code

'*' ( repetition ) operator

The examples shown below work with  lists named my_list containing the following items/elements 1, '1cademy', 12.59, True.

The operator '*' helps to repeat the content of the list.

  • Example for "*" operator
my_list*3

output

[1,  '1cademy',  12.59,  True,  1,  '1cademy',  12.59,  True,  1,  '1cademy',  12.59,  True]

0

1

Updated 2021-03-25

Tags

Python Programming Language

Data Science