logo CodeStepByStep logo

set_tracing2

Language/Type: Python collections set

What values are contained in the following set after this code executes?

nums = set()
nums.add(4)
nums.add(15)
nums.add(73)
nums.add(84)
nums.add(247)
nums.remove(15)
nums.add(42)
nums.add(12)
nums.remove(73)
nums.add(94)
nums.add(11)

(Though sets store their contents in unpredictable order, for this problem, write the values sorted by numeric value of the values, in the format {value, value, value}.)

set contents

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.