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:
state=() for i in a: state=state+(i,)
The above code will work out to concatenate each time a new tuple (i,) into tuple state.
tuple (i,)
I am using python 2.7.9.