Python's Built-in Help Function
Python has a built-in help function
help() that provides an interactive guide to the official Python documentation. Even though I’ve been programming in Python for years, I only just started using this and it’s a real time-saver!
To enter interactive mode type
help() from the Python shell:
Then you can enter either a keyword or object to search for. Want to learn about nonlocal? Just type
You can also look up information on objects, such as the
str object, again by just typing
To exit the interactive mode type
You can also access
help() directly from the Python shell.
To search for an object like
str pass it in directly as
help(str). To search for a keyword, like
nonlocal, pass it in as a string so
Want to improve your Python? I have a list of recommended Python books.