Copyright © tutorialspoint.com
This function takes sequence types and convert them to tuples. This is used to convert a given list into tuple.
tuple( seq ) |
Here is the detail of parameters:
seq: a tuple to be converted into tuple.
It returns the tuple.
#!/usr/bin/python aList = (123, 'xyz', 'zara', 'abc'); aTuple = tuple(aList) print "Tuple elements : ", aTuple |
This will produce following result:
Tuple elements : (123, 'xyz', 'zara', 'abc') |
Copyright © tutorialspoint.com