2.0/10
verdict: needs_serious_help
"Code that goes nowhere, literally."
lang: Python·5 lines
//your_submission
InfiniteIncompetence.py
def count_to_ten():
i = 0
while i < 10:
print(i)
i += 1 //detailed_analysis
!
Infinite Loop
You managed to create a loop that doesn't actually loop due to the misplaced increment. Congrats, you've achieved a new level of incompetence.
!
Logic Fail
It seems you thought the loop condition would magically update the counter for you. Newsflash: it doesn't. You need to increment inside the loop, not after it.
?
Lack of Basic Understanding
This code reeks of a complete disregard for basic programming principles. Did you even try to run this before submitting it, or was this a half-hearted attempt at trying to look like you know what you're doing?
//suggested_fix
InfiniteIncompetence_fixed.py
+def count_to_ten():
+ i = 0
+ while i < 10:
+ print(i)
+ i += 1