Apr-19-2020, 10:16 PM
Thank you for your positive feed back. I'm glad to here that. I will do my best
(Apr-19-2020, 08:13 PM)michael1789 Wrote: You'll have to take a bit of time to learn dictionaries. They are super useful and worth your time. https://www.youtube.com/watch?v=daefaLgNkw0&t=384s is great video.
This is not a complete working example. But after you watch that video or read up on dictionaries a little I can help you further. Any way you want to do it is just as good, but this is an idea to cycle through a dictionary of dictionaries and produce a final dictionary that holds all the info for that particular animal. It's just a rough suggestion. As I said, familiarize yourself with dictionaries and I'll be happy to work you through it as best I can.
Class Animal: def __init__(self): self.dictionaries = {1 : nutrition, #<-- dicts like my previous post 2 : respiratory, 3 : excretory, 4 : reproductive, 5 : climate} self.data = {} self.input_function() def input_function(self): for i in range(1, 5): answer = input(self.dictionaries[i][input_text] self.data.update(i : self.data[i][answer])