The Python set constructor, set(), is a function that crates a Python set - a collection data structure that holds unique unordered elements. The set constructor can create a set out of various iterable data types, such as lists, tuples and strings.
Aside from storing data, dictionaries and lists can also make it easier to write clean code. They can replace cumbersome if/elif, match/case, and long 'or' chains with something simpler.
The difference is short-circuit evaluation, a subtle yet sometimes very significant difference. In short-circuit evaluation, the computer executes the minimum code to figure out the value of a boolean expression.