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!

Ashley Kollar
Ashley Kollar
165 Points

Can you explain str method class in python?

In concerns to finding help within the str method class.

2 Answers

Kenneth Love
STAFF
Kenneth Love
Treehouse Guest Teacher

str is a class, not a method or method class (not sure what that would be). It's the class that represents strings. You can find out more with help(str) in your Python shell.

Ashley Kollar
Ashley Kollar
165 Points

To get help for the method center that belongs to the str class, I'd use _____. I though the answer to this question would have been help(str), yet that does not work. I guess i may be confused about question is there another way to ask this question so I can keep looking for the right answer?

Kenneth Love
Kenneth Love
Treehouse Guest Teacher

In the Help() video, we look up the method rjust that belongs to the str class. You'd look up center the same way but with center instead of rjust, of course.