Python Forum
Help with a schedule maker - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Help with a schedule maker (/thread-4540.html)



Help with a schedule maker - acmichelman - Aug-24-2017

Im new to python but have gone over a couple beginners guide, but I have a project due soon and i'm not sure how to begin programing it.

I have to make a schedule maker for beach lifeguards. All the program would have to do is to randomly put pre entered names onto pre entered beaches, and next to it it would give two random days off. This doesn't have to be a complex solution but if anyone has any idea how to begin programing this or any advice it would be much appreciated.

It would look something like
Main beach- John- Mon, Wed
Main beach- Marry, Sat, Sun
Side beach- Jake- Mon, Fri



RE: Help with a schedule maker - ichabod801 - Aug-24-2017

To get two random days use random.sample, to get one random name use random.choice:

import random
print(random.choice(['John', 'Mary', 'Jake', "Bob"])
print(random.sample(['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri, 'Sat'], 2))