Python convert list in tuple? how

admin
By -
0

What we learning today?




In this post we learning how can we convert python list[] inti tuple()

we can get list output into tuple 

So here we have question how 

in python we its easy because in python we can get many built-in function that help us for doing this

so in this we are using python built-in tuple() function to changing list into tuple


So Here is our Main Code 



lis1 = [1,2,3,4,5]

l_to_t = tuple(lis1)

print(l_to_t)

Here is Our Output

(1, 2, 3, 4, 5)


So What we Doing In Our Code

  • First we Create a list
  • second we create a variable and assign our list into it inside tuple function
  • now we print out variable

What We learn today?

  • How to Convert Python list into tuple using python built-in function






Hope You  like it and its solve your problem.
For more update follow us and share
Have nice day!!!

Tuple in Python, Tuple
Tags:

Post a Comment

0Comments

Put Your Thought or Query Here

Post a Comment (0)