Click here to Skip to main content
15,885,546 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Just wanna start with: I'm sorry, I'm new to this website and Python!

I want to code a program that can be used if you wanna visit a Zoo.
When you start the program it should ask you when you want to visit, and then you enter a date. It´ll also ask you what time you think youre gonna be there and then it'll provide information about what particular animals that are awake that date and time and also if they're being fed.

The animals are supposed to be available at different seasons, for examples the Bears are asleep during the winter etc. So I need to have lists that cover the enitre year ~ 365 days.

I need help with getting started, what methods/functions could I use to call the list of animals that are awake at a the given date and time?
Thank you in advance!
Jasmine

What I have tried:

I have googled and looked on youtube on date methods and found that the most suitable one to use would be datetime
Posted
Updated 19-Nov-17 22:14pm

1 solution

DateTime would certainly be a good idea. But first you need to create some classes for the animals. Each class will contain details of the animal, such as the dates when they are awake etc. I would suggest working through The Python Tutorial — Python 3.4.7 documentation[^] for further ideas.
 
Share this answer
 
Comments
[no name] 20-Nov-17 13:53pm    
I created classes for each animal with the attributes (self, date, time fed) but I am still wondering how I can go about creating the lists that will contain all the days.
Richard MacCutchan 20-Nov-17 14:00pm    
You just need lists of date ranges. Most animals will only be unavailable for a single range.
[no name] 21-Nov-17 5:51am    
Okay, correct me if Im wrong: I'll create lists for the seasons (with dates) using TimdeDelta and then I should somehow attach the right list to each animal that is only availiable for a limited season. And if they're available the entire year then I don't need to attach them to any list.
Richard MacCutchan 21-Nov-17 8:56am    
No, I would add a specific date range in each animal class, as they are likely to be unique to each animal type. If the animal is always available then your range would be empty.
[no name] 21-Nov-17 13:39pm    
Okay Thank you Richard, youre a lifesaver!! I hope it's okay if I come back with more questions..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900