Suppose I have a list:
a=[1,2,3,4,5]
Now I want to convert this list into a tuple. I thought coding something like this would do:
just a kind of precis: (2,) is actually same of tuple([2]) so you can write:
(2,)
tuple([2])
>>>(2,) + tuple([2,3]) (2, 2, 3) >>> tuple([2]) + (2,3) (2, 2, 3) >>> tuple([2]) + tuple([2,3]) (2, 2, 3)
python is very supple indeed