Tuesday, July 10, 2018

How do you convert a List to a Tuple and vice-versa in Python?

You can easily convert from one to the other using the list() and tuple() as shown here.

Here is how from List to Tuple:



And, here is how from Tuple to List:

You can get a hint from Python 3.7.0b2 (v3.7.0b2:b0ef5c979b, Feb 28 2018, 01:32:48) [MSC v.1912 32 bit (Intel)] on win32

as shown here:



No comments: