logo CodeStepByStep logo

set_mystery

Language/Type: Python set collections

What is the output of the following code?

myset = set()
myset.add(74)
myset.add(12)
myset.add(74)
myset.add(74)
myset.add(43)
myset.remove(74)
myset.remove(999)
myset.remove(43)
myset.add(32)
myset.add(12)
myset.add(9)
myset.add(999)
print(sorted(myset))
output
(order shuffled)

You must log in before you can solve this problem.

Log In

Need help?

Stuck on an exercise? Contact your TA or instructor.

If something seems wrong with our site, please

Is there a problem? Contact us.