Robotics & Artificial Intelligence
Answer
An infinite loop or an endless loop is a looping construct in which the number of iterations will never come to an end. The set of statements within the loop block keeps executing infinitely because the given condition never becomes false.
Example:
a = 5
while(a > 0):
print(a*a)
a = a + 1
In the above code, the value of 'a' will always be positive. Hence, the condition (a > 0) will never become false, resulting in never-ending iterations of the loop. Press Ctrl+C keys together to break the running of such an endless loop.