how to append value in tuple
a = (3,)
b = list(a)
b.append("Work!")
a = tuple(b)
print(a)
3.9
10
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')
Thank you!
10
0
Are there any code examples left?
New code examples in category Other