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 trialStacey Normington
5,861 Pointsobject oriented challenge part 2
I don't understand what I'm doing wrong I followed the instructions to write student and its throwing a name error saying student isn't recognised can anyone help.
class Student:
name = "Stacey"
me = Student()
print(name)
1 Answer
Chris Freeman
Treehouse Moderator 68,441 PointsHey Stacey Normington , youโre on the right path.
The defined instance of Student
is me
. To access the attribute name
of me
, use the โdot notationโ me.name
Post back if you need more help. Good luck!!!
Stacey Normington
5,861 PointsStacey Normington
5,861 PointsI tried that out and it comes back saying couldn't find student is there something I'm missing when writing the class
Chris Freeman
Treehouse Moderator 68,441 PointsChris Freeman
Treehouse Moderator 68,441 PointsIf it says, "cannot find Student", this implies a syntax error that prevents the checker from continuing leaving
Student
undefined.The only thing that needs to change is the argument in the
print
statement:name
me.name
.Try again, you'll get this. Of course, post back if you need more help. Always happy to help! Good luck!!