List to Tuple and Tuple to List Type Casting in Python

 Here is the Code to type cast the different type to Data lists into another

Using Blow code we are converting Tuple to List and List to Tuple using Python

Note: we can convert or Cast Collection of Number into Collection of Numbers not single value.

my_list =[1,2,3,4,5]
my_tuple =(1,2,3,4,5)
print(type(my_list))
print(type(my_tuple))
my_tuple_to_list = list(my_tuple)
my_list_to_tuple= tuple(my_list)
print(type(my_tuple_to_list))
print(type(my_list_to_tuple))

Admin

A Software Engineer, Social Media Marketing Expert, writer,

Post a Comment

Previous Post Next Post