Skip to content

Commit 86981af

Browse files
authored
Update Python Program to Reverse a linked list.py
Updated print statements to match current syntax
1 parent 85a68dd commit 86981af

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Python Program to Reverse a linked list.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def push(self, new_data):
3737
def printList(self):
3838
temp = self.head
3939
while(temp):
40-
print temp.data,
40+
print(temp.data)
4141
temp = temp.next
4242

4343

@@ -48,10 +48,10 @@ def printList(self):
4848
llist.push(15)
4949
llist.push(85)
5050

51-
print "Given Linked List"
51+
print("Given Linked List")
5252
llist.printList()
5353
llist.reverse()
54-
print "\nReversed Linked List"
54+
print("\nReversed Linked List")
5555
llist.printList()
5656

5757
# This code is contributed by Nikhil Kumar Singh(nickzuck_007)

0 commit comments

Comments
 (0)