Q:

How to randomly select items in a set

For my homework assignment I am supposed to randomly select items in a list. so far I have this code,
import random

room = range(0, 365)
r = random.choice(room)

mySet = set(r)

However, when I attempt to run the program, it says that " 'int' is no iterable". 
I was wondering how I can fix this problem? 

A:

set() requires an iterable (a list or tuple are iterables) as its argument, where you’ve supplied an integer.

A:

If you want to choose random items (with fixed size) from a set:
list = random.sample(your_set, size);

or if you want to choose random items with random size:
size = random.randint(0, your_set_size):
list = random.sample(your_set, size):

