Write a program to convert a tuple to a list and vice versa

Tech Programmer
0

 

Write a program to convert a tuple to a list and vice versa.



CODE FOR THE ABOVE PYTHON PROGRAM :






WRITTEN CODE FOR THE ABOVE PYTHON PROGRAM :


t = (1, 2, 3, 4, 5)

l = list(t)

print("Tuple converted to list:", l)


l = [6, 7, 8, 9, 10]

t = tuple(l)

print("List converted to tuple:", t)


OUTPUT :




Tags

Post a Comment

0Comments
Post a Comment (0)

Featured Highlighted Categories

You'll discover all of the most up-to-date bring innovative here.

Python List theory with List Programs
Get complete python lists theory and list basic and insane programs for your practice.
CBSE SAMPLE PAPERS
Get CBSE sample and question papers of last 7 years with answers to get best practice for your Board Exams
Python String theory and String Programs
Python strings complete theory with illustrations and practice programs for free