bb zz predict the result of the followingand then paste it into the shell and test (you may not guess python' orderbut see if you can get the right length and the right elements in some order set(['animal''food''animal''food''food''city']constructors we have now seen several examples of the name of type being used as function read these earlier examplesx int(' ' str( nums list(aset set(numberlistin all such cases new object of the specified type is constructed and returned such functions are called constructors mad libs revisited function to ease the creation of mad libs the versions so far of the mad lib program have been fairly easy to edit to contain different mad lib come up with new mad lib story as format string produce the list of cues to prompt the user with the first is creative process the second is pretty mechanical process of looking at the story string and copying out the embedded cues the first is best left to humans the second can be turned over to python function to do automaticallyas many times as we likewith any story if we write the code once writing the python code also takes different sort of creativitywe shall illustrate creative process this is bigger problem than any we have taken on so far it is hard to illustrate creative process if the overall problem is too simple try and follow along read the sample code and pseudo-code there is nothing to try in the shell or editor until further notice if we follow the last version of the mad lib programwe had loop iterating through the keys in the storyand making dictionary entry for each key the main idea we follow here is to use the format string to automatically generate the sequence of keys let us plan this unified task as new functiondef getkeys(formatstring)'''formatstring is format string with embedded dictionary keys return list containing all the keys from the format string ''more to come the keys we want are embedded like {animalthere may be any number of them in the format string this indeterminacy suggests loop to extract them at this point we have only considered for loops there is no obvious useful sequence to iterate through in the loop (we are trying to create such sequence!the only pattern we have discussed that does not actively process each element of significant list is repeat-loopwhere we just use the loop to objects and methods