What is set when we have to use?



What is set when we have to use?..

Answer / Anupriya Ekka

Sets are used in Python when you want to store unique elements in a particular order that does not matter. Sets can be useful for performing operations like intersection, union, difference, and membership checks on collections of data.nnTo create a set, simply enclose the elements in curly braces or use the built-in set() function:nnmy_set = {1, 2, 3}nmy_set = set([4, 5, 6])n

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

How does for loop and while loop differ in python and when do you choose to use them?

1 Answers  


Under what circumstances would von use a while statement rather than for?

1 Answers  


Narrate the difference between python arrays and lists.

1 Answers  


Which ide is best for python on windows?

1 Answers  


What is the starting point of python code execution?

1 Answers  


Explain the disadvantages of python

1 Answers  


What should I make with python?

1 Answers  


How to append to a string in Python?

1 Answers  


Is python good for desktop application?

1 Answers  


What is == in python?

1 Answers  


Does python have a switch-case statement?

1 Answers  


When should you use generator expressions vs. list comprehensions in Python and vice­versa?

1 Answers  


Categories