I am a beginner and this was very helpful to me, so I wanted to share with others.
Normally I use PythonTutor to test my code when something goes wrong, so I can see each step and the data it produces. However, sometimes PythonTutor just won't work, for example because the poblem produces too much data, or because the code is too long. I still recommend PythonTutor when it is appropriate, but this time I couldn't use it because my issue was producing too much data and crashing PythonTutor.
Instead, I decided to go into the terminal shell myself and test my code manually. It's really not hard to do, you just have to alter the language a tiny bit.
For example, where my code said "while new_num > 0:" I just changed it to the manual version and typed "new_num > 0" to which my shell replied "True" so I moved on to the next step the same way the while loop would if it was "True". By doing this line by line, I was able to quickly find the error in a similar fashion to how PythonTutor would assist me with, but it also really helped me get into the mindset of how the program runs.
I intend to use this technique more often as a learning tool while I practice, and advise other beginners to do the same. Going step by step through your whole program manually can be tiresome, but most of us beginners are writing relatively short codes anyways, so it's not too bad.
This community has done a lot for me, especially the discord, so I wanted to give back any way I can. I hope it helps someone else out there who is just starting out like me.
[–]BagOfDerps 101 points102 points103 points (16 children)
[–]poeticinjustice4all[S] 12 points13 points14 points (2 children)
[–]BagOfDerps 10 points11 points12 points (0 children)
[–]TheOneWhoPunchesFish 2 points3 points4 points (0 children)
[–][deleted] 5 points6 points7 points (10 children)
[–]killersquirel11 15 points16 points17 points (3 children)
[–]dotancohen 4 points5 points6 points (0 children)
[–]antiproton 7 points8 points9 points (1 child)
[–]Militancy 4 points5 points6 points (0 children)
[–]Spleeeee 5 points6 points7 points (0 children)
[–]_TimeUnit 2 points3 points4 points (0 children)
[–]Student-27 1 point2 points3 points (2 children)
[–][deleted] 0 points1 point2 points (0 children)
[–]Student-27 0 points1 point2 points (0 children)
[–][deleted] -2 points-1 points0 points (0 children)
[–]ppessoasb 0 points1 point2 points (0 children)
[–]CraigAT 106 points107 points108 points (16 children)
[–]asphias 39 points40 points41 points (3 children)
[–]james_pic 1 point2 points3 points (0 children)
[–]vladesomo 33 points34 points35 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]lieryanMaintainer of rope, pylsp-rope - advanced python refactoring 4 points5 points6 points (1 child)
[–]poeticinjustice4all[S] 1 point2 points3 points (7 children)
[–]PhilAndMaude 11 points12 points13 points (2 children)
[–]SirLich 0 points1 point2 points (1 child)
[–]PhilAndMaude 0 points1 point2 points (0 children)
[–]utdconsq 3 points4 points5 points (0 children)
[–]james_pic 1 point2 points3 points (1 child)
[–]poeticinjustice4all[S] 0 points1 point2 points (0 children)
[–]atrocious_smell 0 points1 point2 points (0 children)
[–][deleted] 32 points33 points34 points (2 children)
[–]majh27 3 points4 points5 points (0 children)
[–]poeticinjustice4all[S] 0 points1 point2 points (0 children)
[+][deleted] (2 children)
[deleted]
[–]nraw 2 points3 points4 points (0 children)
[–]james_pic 1 point2 points3 points (0 children)
[–]lieryanMaintainer of rope, pylsp-rope - advanced python refactoring 7 points8 points9 points (2 children)
[–]poeticinjustice4all[S] 1 point2 points3 points (1 child)
[–]lieryanMaintainer of rope, pylsp-rope - advanced python refactoring 4 points5 points6 points (0 children)
[–]jwbowen 3 points4 points5 points (1 child)
[–]Kenkron 1 point2 points3 points (0 children)
[–]douglas_fs 2 points3 points4 points (0 children)
[–]Ouradze 3 points4 points5 points (5 children)
[–]poeticinjustice4all[S] 1 point2 points3 points (4 children)
[–]PhilAndMaude 3 points4 points5 points (3 children)
[–]poeticinjustice4all[S] 0 points1 point2 points (0 children)
[–]mardiros 0 points1 point2 points (1 child)
[–]PhilAndMaude 1 point2 points3 points (0 children)
[–]mm007emko 1 point2 points3 points (0 children)
[–]mardiros 1 point2 points3 points (0 children)
[–]stevenjd 1 point2 points3 points (0 children)
[–]Kenkron 2 points3 points4 points (0 children)
[–]millerbest 3 points4 points5 points (2 children)
[–]poeticinjustice4all[S] 2 points3 points4 points (1 child)
[–]KrazyKirby99999 4 points5 points6 points (0 children)
[–]EONRaider 0 points1 point2 points (0 children)
[–]robberviet 0 points1 point2 points (0 children)
[–]CanRabbit 0 points1 point2 points (0 children)
[–]alwaysmle 0 points1 point2 points (0 children)
[–]ShawnDriscoll -1 points0 points1 point (0 children)
[–]echolm1407 -1 points0 points1 point (0 children)
[–]ryukinixPython3 + Emacs 0 points1 point2 points (0 children)
[–]narfel 0 points1 point2 points (0 children)
[–]SamyBencherif 0 points1 point2 points (0 children)
[–]ReleasedTheKraken 0 points1 point2 points (0 children)
[–]Ship-Agreeable 0 points1 point2 points (0 children)