In a tutorial I've read that sets can since Python 2.6 be defined like this:
a_set = {"Members", "of", "set"}
But let's say I want to achieve a_set = set("Letters")
with that notation. a_set = {"Letters"}
does not render the same output when printed:
>>> set1 = set("Letters")
>>> set2 = {"Letters"}
>>> print(set1, set2)
{'L', 'r', 't', 'e', 's'} {'Letters'}
Is the tutorial wrong? What is going on here? If set2
is not a set, what is it?