- #1
FallenApple
- 566
- 61
Homework Statement
[/B]
Build a linked list with values of 1, 2 and 3
The Attempt at a Solution
Python:
class ListNode(object):
def _init_(self,x):
self.val=x
self.next=None
root=ListNode(1)
root.next=ListNode(2)
root.next.next=ListNode(3)
print(root.val)
I keep getting error object takes no parameters