Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Python Python Basics (Retired) Say Hello to Python Help Hotline

Why is the help system divided between help() and dir()? It's confusing, at least to me. :-\

Help should give help on every topic related to a keyword, IMHO. What if you don't know whether something is an attribute or not? What does dir() stand for anyway? It looks like the DOS Dir command of yore. Thank you.

1 Answer

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

help() gives you the docstring that's associated with a particular bit of Python. dir() shows you all of the attributes and methods of a particular object's class. They're similar, but fill two different niches. dir() is more exploratory, you're curious what all is available or you forgot the name of something. help() is there to actually explain things a little better.