Copyright © tutorialspoint.com
This function takes sequence types and convert them to lists. This is used to convert a given tuple into list.
Note: Tuple are very similar to lists with only difference that element values of a tuple can not be changed and tuple elements are put between parenthesis instead of square bracket.
list( seq ) |
Here is the detail of parameters:
seq: a tuple to be converted into list.
It returns the list.
#!/usr/bin/python aTuple = (123, 'xyz', 'zara', 'abc'); aList = list(aTuple) print "List elements : ", aList |
This will produce following result:
List elements : [123, 'xyz', 'zara', 'abc'] |
Copyright © tutorialspoint.com