How to Convert Tuple into List in Python? - Tutorial Kart
[Pages:2]How to Convert Tuple into List in Python?
Python ? Convert Tuple into List
You can convert a Python Tuple ot Python List.
list(sequence) takes any sequence, in this case a tuple, as argument and returns a list object.
Example 1 ? Convert Python Tuple to List
In the following example, we initialize a tuple and convert it to list using list(sequence).
example.py ? Python Program
#initialize tuple aTuple = (True, 28, 'Tiger') #tuple to list aList = list(aTuple) #print list print(type(aList)) print(aList)
Output
[True, 28, 'Tiger']
Example 2 ? Convert Python Tuple to List
In the following example, we initialize a tuple with all integers and convert it to a list using list(sequence).
example.py ? Python Program
#initialize tuple aTuple = (67, 28, 41, 37) #tuple to list aList = list(aTuple) #print list print(type(aList)) print(aList)
Output
[67, 28, 41, 37]
Conclusion
In this Python Tutorial, we learned how to convert a tuple into list in Python using list(sequence), with the help of example Python programs.
Python Programming
Python Tutorial Install Python Install Anaconda Python Python HelloWorld Program Python Variables Python Variable Data Type Conversion Python Comments
Control Statements
Python If Python If Else Python While Loop Python For Loop
Python String
Python String Methods Python String Length Python String Replace Python Split String Python Count Occurrences of Sub-String Python Sort List of Strings
Functions
Python Functions
Python Collections
Python List Python Dictionary
Advanced
Python Multithreading
Useful Resources
Python Interview Questions
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related download
- how to convert tuple into list in python tutorial kart
- sympy symbolic computing in python peerj
- matrix mkmat — convert variables to matrix and vice versa stata
- migrating matlab to python enthought
- converting a rotation matrix to a quaternion
- maple lecture 22 array table and conversions
- conversions between s z y h abcd and t parameters empossible
- adjacency matrix or adjacency list more graphs cornell university
- convert adjacency matrix to edge list python
- matrix operations with python and numpy nebomusic
Related searches
- how to convert fractions into percentages
- how to convert tablespoon into ml
- how to convert binary into text
- how to convert density into mass
- how to convert decimals into fractions steps
- how to convert binary into decimal
- how to convert feet into square feet
- how to convert numbers into binary
- how to convert inches into cubic feet
- how to convert fraction into percent
- how to convert decimal into hex
- how to convert grams into moles