So I'm in a beginner's Python course in college and loving it. Python's fun and really easy to use and feels natural. However, while learning about loops today, I accidentally made a very funny infinite loop and was confused why.
i = 1
while i < 6:
print('The value of i is:',i)
i+=1
This will just print "The value of i is 1" forever. We were supposed to use the operator +=, but I accidentally forgot it. My working theory is that this never stops because the "i" variable is never technically updated to be larger than 1, it will just keep detecting it as 1, but why?