How to exit when viewing python help like help(os.listdir)
You are probably in less
(this is configurable through the PAGER
environment variable, but you probably haven't changed that). Press h for help and q to quit.
Other options to exit the help screen would be to type any one of the following(as described in the help section) q,:q,Q,:Q and ZZ .These can be seen when you press 'h' once you are on the help screen