In Python, positive infinity and negative infinity … What while True is used for and its general syntax. Last Updated: August 27, 2020. In this article, I am going to discuss Looping Statements in Python with examples. A loop is a sequence of instructions that iterates based on specified boundaries. Please read our previous article where we discussed Conditional Statements in Python with examples. Python programming offers two kinds of loop, the for loop and the while loop. Purpose and Use Cases for While Loops. VS is unresponsive to Ctl-C. But two problems have risen from my program. Infinite loop – At the start, we can set only a condition. ; for in Loop: For loops are utilized for successive crossing.For instance: navigating a rundown or string or exhibit and so forth In Python, there is no C style for loop, i.e., for (i=0; i= 1): print(x) The above code is an example of an infinite loop. One of the key aspect of writing while loops is watching your counters. for statement in Python. As you can see, these loop constructs serve different purposes. Python For Loops. But we can use float (inf) as an integer. In while loop way of iterating the list, we will follow a similar approach as we observed in our first way, i.e., for-loop method. Python Looping Techniques. Dec-03-2018, 03:22 PM . This tutorial shows you how to create an infinite loop program in Python. For example: traversing a list or string or array etc. In other words, we need a loop, and the most simple looping mechanism in Python is the while loop. Posts: 2. Python While Loop Exercises. Loops are terminated when the conditions are not met. Copy link Quote reply dzittin commented Aug 2, 2020.