19. What are endless loops ? Why do such loops occur ?

Endless loops are loops which don’t terminate for the condition never becomes False. They occur because the variable in the condition is not being updated correctly.

k = 5
while K > 0: # variable is not being updated

while k > 0: # variable is being updated incorrectly in the opposite direction
k += 1