Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert set to list python time complexity

# Using Set Comprehension to convert list to set Python
# In this method, we will be using set comprehension.


# a is defined list
a = [1,2,3,'seeker',3,7.5]

t = {x for x in a} # set comprehension
print(t)

# Output:
# {1, 2, 3, 7.5, ‘seeker’}

# Time of execution 0.00018290
 
PREVIOUS NEXT
Tagged: #convert #set #list #python #time #complexity
ADD COMMENT
Topic
Name
4+3 =