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 trialSergei Miroshnikov
3,313 Pointsprint(str) no longer behaves as in example , it just prints <class 'str'>
Nothing more to add
3 Answers
Kenneth Love
Treehouse Guest Teacherstr
is a built-in for the string class. Did you assign a value to it before you tried to do print(str)
? If not, yes, it prints what you posted, which is the representation of the class.
Sergei Miroshnikov
3,313 PointsI finally got it , I misplaced help(str) and print(str) , everything works as intended , my mistake , thank you .
MUZ141141 Cleopass Kapembeza
677 Pointsmmm i think they is no answer yet since i have tried all your methods to get help to (str) but no clue.i dont have the answer now, i am still searching
Kenneth Love
Treehouse Guest Teacherhelp(str)
will give you the help documentation for the str
class.
Sergei Miroshnikov
3,313 PointsSergei Miroshnikov
3,313 PointsThanks that helped .
Ok , I re-tried that , I typed str(3) in the python shell , got '3' as result , and then when I typed help(str) I got help on class . Why did this work that way ? I mean, why I had to do this initialization ? I need to initialize every class each time before I use help ?
Kenneth Love
Treehouse Guest TeacherKenneth Love
Treehouse Guest TeacherNope, you can just do
help(str)
right away and get help on it.