Pro tip: print() after every 3 lines saved me from a week of head scratching | Coding For Beginners - Freelance Forum - The Community for Independent Professionals
Pro tip: print() after every 3 lines saved me from a week of head scratching
I kept getting a wrong total in my first Python script last month and spent two nights staring at it. A guy in a Discord server for new coders asked if I was printing values as I go, and I admitted I only checked the final result. So I added a print() after every few lines and the bug showed up in about 10 seconds: I was adding a string to a number halfway through a loop. Feels dumb now but I would probably still be stuck on it. Does anyone else print a ton while learning, or do you just read the code slower?