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
Eva Feng
1,810 PointsProblem with class Node
When I ran the code in this video the console shows TypeError: Node() takes no arguments
Why is that?
2 Answers
Steven Parker
243,228 PointsIt sounds like you may have an error in the definition of the __init__ method in class Node.
If you need help with finding it, share your workspace with us so we can take a look.
Here's a video about sharing a snapshot of your workspace.
Eva Feng
1,810 PointsBy typing the following in console: python -i linked_list.py
and error message will show up saying Node() takes no arguments. Could it be the set up of my PC?
Laura Coronel
Treehouse TeacherHi Eva Feng,
I see the issue — lines 10 to 14 need to be indented. Python is very particular about indentation, and right now, your init and repr methods are not part of the Node class because they’re aligned at the same level as the class definition.
Once you indent lines 10 to 14 so they’re inside the class, the error should go away.
Eva Feng
1,810 PointsEva Feng
1,810 PointsThank you Steven. Here is my workspace. Would be grateful if you can take a look.
https://w.trhou.se/5ohdvscewe
Steven Parker
243,228 PointsSteven Parker
243,228 PointsWhen I run your code in the workspace, I get no errors. Exactly how are you running it?