Dec-11-2019, 04:16 PM
there are plenty of possibilities, e.g.
from itertools import cycle from collections import Counter from random import shuffle students = ['Joey', 'Henry', 'Daniel', 'James', 'Samantha', 'Jose', 'Salvator', 'Paul', 'Steve', 'Mary', 'Kyle', 'Marcus', 'Pat'] dates = ['Jan 6', 'Jan 8', 'Jan 10'] shuffle(students) schedule = dict(zip(students, cycle(dates))) print(schedule) print(Counter(schedule.values()).most_common())
Output:{'Steve': 'Jan 6', 'Mary': 'Jan 8', 'Kyle': 'Jan 10', 'Jose': 'Jan 6', 'Henry': 'Jan 8', 'Marcus': 'Jan 10', 'Paul': 'Jan 6', 'James': 'Jan 8', 'Salvator': 'Jan 10', 'Samantha': 'Jan 6', 'Joey': 'Jan 8', 'Pat': 'Jan 10', 'Daniel': 'Jan 6'}
[('Jan 6', 5), ('Jan 8', 4), ('Jan 10', 4)]
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs