Creating tuple with elements

To create a tuple, fill the values in tuple separated by commas:

tup1 = (1,2,3,4.6, "hello", "a")

If you define the variable as follows:

a = 1,2,3

The variable a would be a tuple:

>>> tup1 = 1,2,3,4
>>> tup1
(1, 2, 3, 4)
>>>
>>> type(tup1)
<type 'tuple'>
>>>
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.107.100