Articles → Python → Convert A List To A Tuple Using The Tuple Function In Python

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)




  1. We have created a list of numbers
  2. Print the list
  3. Convert the list to a tuple
  4. Print the tuple



Output


Picture showing the output of converting a list to a tuple using the tuple function in python



Posted By  -  Karan Gupta
 
Posted On  -  Tuesday, February 26, 2019

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250