6
abkcode
7y

Too many conditions in my brain not allowing me to code a single line.

Comments
  • 0
    That's simple if-elif-else statement...
  • 0
    Been there. It can help to break it down to a single branch. Or a single limb of a single branch.

    Or think about it backwards from the results you want or from the available possible outcomes that could occur and see how your inputs could result in those outcomes.

    Or you could put a bunch of debug statements in and watch it run step back step slowly...
  • 1
    If you have monolithic checks, try and use a switch statement instead.
    Else, look into finite state machines
  • 0
    It's way more complex than what is shown in the picture
Add Comment