basic for loops try the following in the shell you get sequence of continuation lines before the shell responds after seeing the colon at the end of the first linethe shell knows later lines are to be indented be sure to enter another empty line (just press enter at the end to get the shell to respond for count in [ ]print(countprint('yescountthis is for loop it has the heading starting with forfollowed by variable name (count in this case)the word insome sequenceand final colon as with function definitions and other heading linesthe colon at the end of the line indicates that consistently indented block of statements follows to complete the for loop for item in sequenceindented statements to repeatmay use item the block of lines is repeated once for each element of the sequenceso in this example the two lines in the indented block are repeated three times furthermore the variable in the heading (count heremay be used in the blockand each time through it takes on the next value in the sequenceso the first time through the loop count is then and finally look again at the output and see that it matches this sequence more detailed sequence is givenplaying computerin the tableline count comment start with the first element of the list print 'yes is 'yes'print yes change count to the next element in the list print 'yes is 'yesyes'print yesyeschange count to the next element in the list print 'yes is 'yesyesyes'print yesyesyesdone with list when executing step by stepnote that the for loop heading serves two purposeseach time the heading line executesit implicitly assigns new value to the variable name you use in place of item after each execution of the heading linethe statements in the indented block are executedgenerally making use of the the new value for the variable assigned in the heading notewhen playing computer with loopthe same line numbers can reappear over and overbecause the for loop heading line and the indented body under it are each executed repeatedly each time one of these lines is executedit must be listed separatelyin time sequencea for loop is technically single compound statement its level of indentation is considered to be the level of indentation of its heading when you used the shell to enter loopthere was reason that the interpreter waited to respond until after you entered an empty linethe interpreter did not know how long the loop block was going to bethe empty line is signal to the interpreter that you are done with the loop blockand hence ready to execute the complete compound loop statement look at the following example program for pyand run it loops and sequences