print(itemand just go through the list and do it for each one (copy and run if you like items ['red''orange''yellow''green'for item in itemsprint(itemclearly the more elaborate version with numbers has pattern with some consistencyeach line is at least in the formnumber item but the number changes each timeand the numbers do not come straight from the list of items variable can changeso it makes sense to have variable numberso we have the potential to make it change correctly we could easily get it right the first timeand then repeat the same number read and run the example program numberentries py'''in this version number does not change ''items ['red''orange''yellow''green'number for item in itemsprint(numberitemof course this is still not completely correctsince the idea was to count after the first time number is printedit needs to be changed to to be right the next time through the loopas in the following coderead and run the example program numberentries py'''prints poorly numbered entries from the list''items ['red''orange''yellow''green'number for item in itemsprint(numberitemnumber will change to after printing this is closerbut still not completely correctsince we never get to we need way to change the value of number that will work each time through the loop the pattern of counting is simpleso simple in fact that you probably do not think consciously about how you go from one number to the nextyou can describe the pattern by saying each successive number is one more than the previous number we need to be able to change number so it is one more than it was before that is the additional idea we needchange the last line of the loop body to get the example program numberentries py see the addition and run it items ['red''orange''yellow''green'number for item in itemsprint numbered entries print(numberitemnumber number crucial added line it is important to understand the step-by-step changes during execution below is another table showing the results of playing computer the line numbers are much more important here to keep track of the flow of controlbecause of the jumping around at the end of the loop again note that the program line numbers in the line column of the playing computer table are not all listed sequentiallybecause the for loop heading line and the indented body under it are each executed repeatedly for compactnessthe variable items does not get its own columnsince it always has the value shown in the comment in line loops and sequences