1

Hello I am trying to build a zoo calander small script that links a Zoo animal by random to a day in the week.

I currently have this code

    month = datetime.now().month
year = datetime.now().year
today = date.today()
day = datetime.now().day
my_date = date.today()
DayOfWeek = calendar.day_name[my_date.weekday()]
animallist1 = {'Dog': ['Dog1'],
              'Cat': ['Cat1'],
              'Parrot': ['Parrot1'],
              'Donkey': ['Donkey1'],
              'Snake': ['Snake1'],
              'Fish': ['Fish1']}
animallist22 = ['Dog', 'Cat', 'Parrot', 'Donkey', 'Snake', 'Fish']
ListOfanimals = random.sample(animallist2, len(animallist2))
d = date(year, month, day)
d += timedelta(days=0 - d.weekday())
print(d)

but i cannot figure out how to go over the weeks by random and pick a zoo animal? Can someone help me.

whatevs200
  • 11
  • 1
  • Does this answer your question? [iterating-through-a-range-of-dates-in-python](https://stackoverflow.com/questions/1060279) and [How to get back fo first element in list after reaching the end?](https://stackoverflow.com/a/55054811/7414759) – stovfl Jul 30 '20 at 13:52

0 Answers0