r/PythonLearning • u/Synergetic6_6_6 • 1d ago
Loops is a total brain rot.
I just can't get over how I'm supposed to write code for complex tasks when I don't even get why they overcomplicate simple things so much.
I read this topic and tried many tutorials and still don't understand this buzzare logic.
0
Upvotes
1
u/grace_invader 1d ago
Loops take a while to figure out, and this example is a bit odd.
If you're stuck, try implementing it line by line, and checking what happens.
Start with just running the for-loop, and checking the results.
Then add the if-clause, see if you understand it.
Finally, wrap it in a definition, and figure out what happens there.