Answers for "how to create a set from a list in python"

11

how to convert a set to a list in python

my_set = set([1,2,3,4])
my_list = list(my_set)
print my_list
>> [1, 2, 3, 4]
Posted by: Guest on May-19-2020
1

list set python

myset = {"apple", "banana", "cherry"}
mylist = ["dog", "cat", "humanoid"]
mydict = {'planet': 'blue', 'edges': 4, 'perimeter':15}
Posted by: Guest on May-03-2021
0

how to create a set from a list in python

my_set = set([1, 2, 3])
my_list = list(my_set)

# By far the easiest way.
Posted by: Guest on March-05-2022

Code answers related to "how to create a set from a list in python"

Python Answers by Framework

Browse Popular Code Answers by Language