- A Square brackets
- BCurly brackets
- CParenthesis
- DNone of the above
--------------------------------------------------------------------------- IndexError Traceback (most recent call last) Input In [6], in() 3 for i in a: 4 if i%2==0: ----> 5 s=s+a[i] 6 print(s) IndexError: tuple index out of range |
We can use *
operator to repeat the tuple values n
number of times.
For example:
("abc",)*3
will return('abc', 'abc', 'abc')