Question #722

What is the output of the code snippet below?
my_set = {1, 'Python', ('John', 'Jeanne'), True}
print(my_set)

As a set is a collection of hashables, and as 1 == True evaluates to True , the set will remove True only to keep 1 instead. (python.org/dev/peps/pep-0285)


Comment on Disqus:

Question difficulty: ๐Ÿ”ต๐Ÿ”ต๐Ÿ”ต๐Ÿ”ต๐Ÿ”ต


Similar questions: