convert set to list Python

In this tutorial, we will see how to convert set to list in python.
You can use python list() function to convert set to list.It is simplest way to convert set to list.

Let’s understand with the help of example.

Output:

set of Fruits: {‘Apple’, ‘Banana’, ‘Orange’}
listOfFruits: [‘Apple’, ‘Banana’, ‘Orange’] set of scales: {1, 2, 3, 4, 5}
list of scales: [1, 2, 3, 4, 5]

As you can see, list starts with open square bracket and ends with close square bracket.

Was this post helpful?

Leave a Reply

Your email address will not be published. Required fields are marked *