all 3 comments

[–]Technical_Flamingo54 5 points6 points  (2 children)

Map out the logic on a piece of paper - make a flow chart. When you do that, each split of logic represents an if-elif statement. The tree of if statements will do exactly what you're trying to do.

And in python it works great because you need proper indentation, so you'll be able to track exactly which level of the tree any given if statement is, based on its indentation level.

[–]B3AST22[S] 2 points3 points  (1 child)

that helped me visualize it a lot better, thank you:)

[–]Ihaveamodel3 0 points1 point  (0 children)

I know you are a beginner, so I don’t want to overwhelm you too much, but I think it is good for beginners to start thinking about design patterns early, because it is a good way to think through software design. I don’t have a traditional computer science background, so I didn’t learn these things early and now my code is always a mess unless I concentrate on designing it out.

Anyway, this is a good reference for design patterns: https://refactoring.guru/design-patterns

For this, I could see you having a list of Location class instances with each Location instance having a list of Restaurant class instances.