We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d8a294 commit cf03d1eCopy full SHA for cf03d1e
data_structures/3_LinkedList/3_linked_list.py
@@ -12,11 +12,9 @@ def print(self):
12
print("Linked list is empty")
13
return
14
itr = self.head
15
- llstr = ''
16
while itr:
17
- llstr += str(itr.data)+' --> ' if itr.next else str(itr.data)
+ print(itr.data, end="-->") if itr.next is not None else print(itr.data)
18
itr = itr.next
19
- print(llstr)
20
21
def get_length(self):
22
count = 0
0 commit comments