Python Forum
Help with a schedule maker
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with a schedule maker
#2
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))
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
Help with a schedule maker - by acmichelman - Aug-24-2017, 01:51 AM
RE: Help with a schedule maker - by ichabod801 - Aug-24-2017, 01:59 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020