April 6, 2024, 10:13 p.m. | Sakshi

DEV Community dev.to

Hello geeks!


After tuple and lists, lets see sets.





Python Unleashed 09





How to create set


There are two ways to define a set in Python. You can use the set() function, which takes in a iterable and converts the iterable to a set.



Showing you the first way of creating set, when you have elements ready with you


set = {"this", "is", "a", "set",12,True}



See what error we get here. And what's unhashable type.


To get better understanding of …

computerscience datastructures function hello iterable lists python set tutorial

Lead Developer (AI)

@ Cere Network | San Francisco, US

Research Engineer

@ Allora Labs | Remote

Ecosystem Manager

@ Allora Labs | Remote

Founding AI Engineer, Agents

@ Occam AI | New York

AI Engineer Intern, Agents

@ Occam AI | US

AI Research Scientist

@ Vara | Berlin, Germany and Remote