form role comments in-file documentation the dir function lists of attributes available in objects docstrings__doc__ in-file documentation attached to objects pydocthe help function interactive help for objects pydochtml reports module documentation in browser sphinx third-party tool richer documentation for larger projects the standard manual set official language and library descriptions web resources online tutorialsexamplesand so on published books commercially polished reference texts comments as we've learnedhash-mark comments are the most basic way to document your code python simply ignores all the text following (as long as it' not inside string literal)so you can follow this character with any words and descriptions meaningful to programmers such comments are accessible only in your source filesthoughto code comments that are more widely availableyou'll need to use docstrings in factcurrent best practice generally dictates that docstrings are best for larger functional documentation ( "my file does this")and comments are best limited to smaller code documentation ( "this strange expression does that"and are best limited in scope to statement or small group of statements within script or function more on docstrings in momentfirstlet' see how to explore objects the dir function as we've also seenthe built-in dir function is an easy way to grab list of all the attributes available inside an object ( its methods and simpler data itemsit can be called with no arguments to list variables in the caller' scope more usefullyit can also be called on any object that has attributesincluding imported modules and built-in typesas well as the name of data type for exampleto find out what' available in module such as the standard library' sysimport it and pass it to dirimport sys dir(sys['__displayhook__'more names omitted 'winver'these results are from python and ' omitting most returned names because they vary slightly elsewhererun this on your own for better look in factthere are currently attributes in systhough we generally care only about the that do not have leading double underscores (two usually means interpreter-relatedor the that have no the documentation interlude