syntax

Python for and while loop

loop is exactly a iteration, which means executing the same block of code over and over, potentially many times. In python we use while and for loop for repeating the process. For Loop For loop is the type of iteration to repeat the process, In python we use for and…