Answers for "tuples append"

3

append to a tuple

a = ('tree', 'plant', 'bird')
b = ('ocean', 'fish', 'boat')
# a and b are both tuples

c = a + b
# c is a tuple: ('tree', 'plant', 'bird', 'ocean', 'fish', 'boat')
Posted by: Guest on June-13-2021
0

how to add number in tuple

a = ('2',)
b = 'z'
new = a + (b,)
Posted by: Guest on August-04-2020

Browse Popular Code Answers by Language