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
Emeka Okoro
Courses Plus Student 11,724 PointsUsing the help function in the Python shell
Please I'm stuck trying to use the help function in the Python shell as I'm confused. Typing help('treehouse'.startswith('t')) returns help for boolean and help(startswith) returns an error. How do I get help for the startswith method in the shell ? thanks in advance!!
1 Answer
Alexander Davison
65,469 PointsTry this:
help(str.startswith)
Notice that you shouldn't call the function (I didn't use parantheses), you just want to refer to that function.
Also, if the function is part of something else, in this case, strings, you actually can use any string, but I like just "str" alone.
Emeka Okoro
Courses Plus Student 11,724 PointsEmeka Okoro
Courses Plus Student 11,724 PointsThanks bud!
Alexander Davison
65,469 PointsAlexander Davison
65,469 PointsNo probs!