secondthis also lets you import the program so that you can call and test individual functions if the memorypuzzle py file is in the :\python folderthen you can import it from the interactive shell type the following to test out the splitintogroupsof(and getboxatpixel(functions to make sure they return the correct return valuesimport memorypuzzle memorypuzzle splitintogroupsof( [ , , , , , , , , , ][[ ][ ][ ][ ]memorypuzzle getboxatpixel( (nonenonememorypuzzle getboxatpixel( ( when module is importedall of the code in it is run if we didn' have the main(functionand had its code in the global scopethen the game would have automatically started as soon as we imported itwhich really wouldn' let us call individual functions in it that' why the code is in separate function that we have named main(then we check the built-in python variable __name__ to see if we should call the main(function or not this variable is automatically set by the python interpreter to the string '__main__if the program itself is being run and 'memorypuzzleif it is being imported this is why the main(function is not run when we executed the import memorypuzzle statement in the interactive shell this is handy technique for being able to import the program you are working on from the interactive shell and make sure individual functions are returning the correct values by testing them one call at time why bother with readabilitya lot of the suggestions in this haven' been about how to write programs that computers can run so much as how to write programs that programmers can read you might not understand why this is important after allas long as the code workswho cares if it is hard or easy for human programmers to readhoweverthe important thing to realize about software is that it is rarely ever left alone when you are creating your own gamesyou will rarely be --done|with the program you will always get new ideas for game features you want addor find new bugs with the program because of thisit is important that your program is readable so that you can look at the code and understand it and understanding the code is the first step to changing it to add more code or fix bugs as an examplehere is an obfuscated version of the memory puzzle program that was made entirely unreadable if you type it in (or download it from email questions to the authoral@inventwithpython com