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
erik Jones Oniga
3,307 Pointsstr.center
Hello Guys,
could you explain me, what means ,,str. or str.center''. I just can't get it..
1 Answer
Chris Freeman
Treehouse Moderator 68,468 PointsPython has many built-in object types such as str. As an object, there are many methods included that help operate on the string. The method center has the following definition:
str.center(width[, fillchar])
Return centered in a string of length width. Padding is done using the specified fillchar
(default is an ASCII space). The original string is returned if width is less than or equal to len(s).
Post back if you need more help! Good luck!!