Answers for "how to cast a list into a tuple python"

0

List to tuple

sample_list = ['Compile', 'With', 'Favtutor']

#unpack list items and form tuple
tuple1 = (*sample_list,)

print(tuple1)
print(type(tuple1))
Posted by: Guest on October-04-2021

Code answers related to "how to cast a list into a tuple python"

Python Answers by Framework

Browse Popular Code Answers by Language