if you wish to see or run the whole program with this small modificationsee the example madlibloop py common naming convention is used in the programeach element in the list is cuewhile the list with all the elements is named with the plural cues in later situations make list name be the plural of the variable name used for an individual item of the list note the logic of the transformation between the two program versionsthe alternative pieces of data are collected in the list in the for loop heading single variable name (here chose cueis used in the heading as placeholder to refer to the current choice being handledand the body refers to this variable cue in place of the explicit data values included each time in the original no-loop version it is important to understand the sequence of operationshow execution goes back and forth between the heading and the body here are the details heading first timevariable cue is set to the first element of the sequence'animal body first timesince cue is now 'animal'effectively execute addpick('animal'userpicks(skip the details of the function call in this outline heading second timevariable cue is set to the next element of the sequence'food body second timesince cue is now 'food'effectively execute addpick('food'userpicks heading third timevariable cue is set to the next (lastelement of the sequence'city body third timesince cue is now 'city'effectively execute addpick('city'userpicks heading donesince there are no more elements in the sequencethe entire for loop is done and execution would continue with the statement after it (not indentedin this example the data values are just few given literalsand there is only one line in the repeated pattern hence the use of for loop is not big dealbut it makes simple examplethis looping construction would be much handier if you were to modify the original mad lib exampleand had story with many more cues also this revision will allow for further improvements in the revised mad lib program (page )after we introduce more about string manipulation pattern loop exercise write two-line for-each loop in file types py containing call to the type functionso that this code with the for-each loop produces exactly the same printed output as the code in example file types py the types py code is shown belowprint( type( )print( type( )print([]type([])print(truetype(true)print(nonetype(none)execute both versions to check yourself hint hint triple exercise complete the following function this starting code is in triplestub py save it to the new name triple py note the way an example is given in the documentation string it simulates the use of the function in the shell this is common convention the elements of the list in the for loop heading are not all of the same type you need to use the loop variable twice in the loop body loops and sequences