Source Code:
(back to article)
my_tuple = (1, 2, 3) new_tuple = my_tuple[:2] + (4,) + my_tuple[2:] print(new_tuple) # Output (1, 2, 4, 3)
Result:
Report an issue