H
18

Tbh I was stuck on a loop for like 2 hours trying to make a simple list

I was trying to print a list of names in Python for a class project. Every time I ran it, it would just show the last name. I kept rewriting the same basic loop over and over. Then I watched a 5 minute video from a channel called 'Coding with Mosh' and he showed the indent was wrong by one space. I fixed that single space and the whole thing worked perfectly. Has anyone else had a tiny syntax error waste a huge chunk of time?
2 comments

Log in to join the discussion

Log In
2 Comments
jesse_barnes37
Indentation errors are the worst. I once spent an entire evening because I mixed tabs and spaces in a config file. The parser saw it as valid, but the logic was completely broken. It's crazy how a single invisible character can make a program do something totally unexpected. What was the actual loop structure that gave you trouble?
3
rowan666
rowan6668d ago
My buddy lost a whole day to a Python loop that looked fine but ran backwards.
1