Python Basics
Python Advanced
Python Useful References
Python Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM
|
Python Tuple tuple() Function
Description:
This function takes sequence types and convert them to tuples. This is used to convert a given list into tuple.
Syntax:
Parameters:
Here is the detail of parameters:
Return Value:
It returns the tuple.
Example:
#!/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')
|
|
|
|