Computer Science, asked by ankit18384, 10 months ago

Create a list having numbers [[1,4,7,10,.....100] as its elements and then create a set from this list by python ​

Answers

Answered by tiger009
0

Convert list into set

Output:

{43, 12, 78, 23, 22, 54}

Explanation:

#define function

def con(lst):

 #convert list into set

 return set(lst)

lst=[23,43,54,12,22,78]

print(con(lst))

The following are description of the program.

  • Firstly, define function 'con()' and pass argument 'lst' in its parameter.
  • Then, convert the list into the set through the 'set()' pre-defined function that converts the string or list into the tuple and return that converted set result.
  • Finally, declare and initialize the list variable to '[23,43,54,12,22,78] ' then, call and print the function by passing argument in its parameter.

Learn More:

https://brainly.in/question/9030209

Similar questions