How do you create a set with 3 values in Python?
Experience Level: Junior
Tags: Python
Answer
Example:
my_set = {"red", "amber", "green"}
print(my_set)
Related Python job interview questions
What does [2:] syntax do on str in Python?
Python JuniorWhat is a decorator in Python?
Python JuniorWhy would you return self from a class method?
Python JuniorHow do you detect if the optional parameter value was set?
Python JuniorHow do you define an optional parameter with no value in Python?
Python Junior