I keep reading about endless loops, is that something you want or do you always have to control an endless loop situation?
sneekula 969 Nearly a Posting Maven
Recommended Answers
Jump to PostAccidental endless loops are the once you have to watch out for. The 'while loop' is more prone to this either through faulty escape logic or accidental use of the control variable:
# accidental endless loop # this is okay in Python for k in range(10): k …
Jump to PostEven if you don't forget to put the counter into the 'while loop' you can still make an error ...
# now you have an accidental endless loop k = 0 while k < 10: # the k counter k += 1 print k # more code …
All 6 Replies
jrcagle 77 Practically a Master Poster
sneekula 969 Nearly a Posting Maven
bumsfeld 413 Nearly a Posting Virtuoso
vegaseat 1,735 DaniWeb's Hypocrite Team Colleague
jrcagle 77 Practically a Master Poster
bumsfeld 413 Nearly a Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.