How to repeat elements in a tuple with Python

1 Answer

0 votes
tpl = (1, 2, 3, 4)

repeated_tuple = tpl * 2

print(repeated_tuple) 


 
'''
run:
 
(1, 2, 3, 4, 1, 2, 3, 4)

'''

 



answered Dec 19, 2024 by avibootz
...