Skip to content

Commit cf03d1e

Browse files
committed
Update 3_linked_list.py
Removed llstr variable in 3_linked_list.py file.
1 parent 4d8a294 commit cf03d1e

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

data_structures/3_LinkedList/3_linked_list.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,9 @@ def print(self):
1212
print("Linked list is empty")
1313
return
1414
itr = self.head
15-
llstr = ''
1615
while itr:
17-
llstr += str(itr.data)+' --> ' if itr.next else str(itr.data)
16+
print(itr.data, end="-->") if itr.next is not None else print(itr.data)
1817
itr = itr.next
19-
print(llstr)
2018

2119
def get_length(self):
2220
count = 0

0 commit comments

Comments
 (0)