Articles → Python → Convert A List To A Tuple Using The Tuple Function In PythonConvert A List To A Tuple Using The Tuple Function In PythonIn this article, we will convert a list to a tuple using the tuple function in Python.Example list = [10,5,7,22,11,17] print (list) list = tuple(list) print(list)In the above code, we have created a list of numbers. In the second line of code, we are printing the value of the list. In the third and fourth lines, we convert the list to the tuple and then print the tuple.Output Posted By - Karan Gupta Posted On - Tuesday, February 26, 2019 Query/Feedback Your Email Id Subject Query/Feedback Characters remaining 250
list = [10,5,7,22,11,17] print (list) list = tuple(list) print(list)
Query/Feedback