iteration while trueline input(''if line[ ='#'continue if line ='done'break print(lineprint('done!'codehere is sample run of this new program with continue added hello there hello there don' print this print thisprint thisdone doneall the lines are printed except the one that starts with the hash sign because when the continue is executedit ends the current iteration and jumps back to the while statement to start the next iterationthus skipping the print statement definite loops using for sometimes we want to loop through set of things such as list of wordsthe lines in fileor list of numbers when we have list of things to loop throughwe can construct definite loop using for statement we call the while statement an indefinite loop because it simply loops until some condition becomes falsewhereas the for loop is looping through known set of items so it runs through as many iterations as there are items in the set the syntax of for loop is similar to the while loop in that there is for statement and loop bodyfriends ['joseph''glenn''sally'for friend in friendsprint('happy new year:'friendprint('done!'in python termsthe variable friends is list of three strings and the for loop goes through the list and executes the body once for each of the three strings in the list resulting in this output we will examine lists in more detail in later