tuple push
a = ('Product', '500.00', '1200.00')
a = list(a)
a.insert(3, 'foobar')
a = tuple(a)
print a
>> ('Product', '500.00', '1200.00', 'foobar')
tuple push
a = ('Product', '500.00', '1200.00')
a = list(a)
a.insert(3, 'foobar')
a = tuple(a)
print a
>> ('Product', '500.00', '1200.00', 'foobar')
how to add number in tuple
a = ('2',)
b = 'z'
new = a + (b,)
how to append a tuple to a list
a_list = []
a_list.append((1, 2)) # Succeed! Tuple (1, 2) is appended to a_list
a_list.append(tuple(3, 4)) # Error message: ValueError: expecting Array or iterable
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us