Below are a few examples to convert a set to a list in Python Programming using the builtin list() function..
Example 1:
cities_set = {"New York", "London", "Paris", "Tokyo", "Mumbai"}
cities_list = list(cities_set)
print(cities_list)

Example 2:
numbers_set = {3.21, 4, 5, 27, 2.1}
numbers_list = list(numbers_set)
print(numbers_list)

Provide Feedback For This Article
We take your feedback seriously and use it to improve our content. Thank you for helping us serve you better!
😊 Thanks for your time, your feedback has been registered!
Comments & Discussion
Facing issues? Have questions? Post them here! We're happy to help!