python for artificial intelligence and fun list are equivalent to the first two (except fun list uses different variableone of the advantages of using the embedded definitions (as in fun and fun aboveover the lambda is that is it possible to add __doc__ stringwhich is the standard for documenting functions in pythonto the embedded definitions generators and coroutines python has generators which can be used for form of coroutines the yield command returns value that is obtained with next it is typically used to enumerate the values for for loop or in generators (the yield command can also be used for coroutinesbut we only us it for genertors in aipython version of the built-in rangewith or arguments (and positive stepscan be implemented aspythondemo py -(continued def myrange(startstopstep= )"""enumerates the values from start in steps of size step that are less than stop ""assert step> "only positive steps implemented in myrangei start while <stopyield +step print("list(myrange( , , )):",list(myrange( , , ))note that the built-in range is unconventional in how it handles single argumentas the single argument acts as the second argument of the function note also that the built-in range also allows for indexing ( range( )[ returns )which the above implementation does not however myrange also works for floatswhich the built-in range does not exercise implement version of myrange that acts like the built-in version when there is single argument (hintmake the second argument have default value that can be recognized in the function yield can be used to generate the same sequence of values as in the example of section pythondemo py -(continued def ga( )"""generates square of even nonnegative integers less than ""for in range( )if % == yield * ga( version june