0

[Solved] The else condition on line 169 triggers, the other ones (lines 124 and 146) do not. Why?

https://code.sololearn.com/cmU5n08Tx65e/?ref=app

19th Oct 2020, 9:07 AM
Adam Stork
Adam Stork - avatar
3 odpowiedzi
+ 1
Please remove spaces between lines and use 2 spaces indentations for each block of code to see what's happening to answer your question.
19th Oct 2020, 9:57 AM
QTWizard
+ 1
QTWizard I have actually been meaning to look into style standards as my codes have been growing bigger this past week. So thank you for making me not put it off any longer. :) I am reading PEP 8 and will update my code accordingly.
19th Oct 2020, 10:28 AM
Adam Stork
Adam Stork - avatar
+ 1
Update: The code I posted earlier was a giant mess, I see it now. I grouped most of the program's functions under one 'main' function, I even used loops and exceptions in places where they absolutely did not belong. Both resulting in all those unnecessary indents and overall mess. So I am in the process of completely redesigning the program (in accordance with PEP 8) and so far it looks and works incomparably better than before. By doing so I also fixed my original issue as I created a simple loop rather than separate functions which was just incredibly inefficient in retrospect. So, thank you, QTWizard, for helping me see my mistakes on my own! I appreciate it!
19th Oct 2020, 9:41 PM
Adam Stork
Adam Stork - avatar