Home > other >  Python linked list TypeError: 'linked_list' object is not iterable
Python linked list TypeError: 'linked_list' object is not iterable

Time:06-08

i have created a linked list but when i tried to use for loop to browse thru the linked list it says TypeError: 'linked_list' object is not iterable

Your help will be greatly appreciated. Thanks in advance!

enter image description here You already finished the right function in your class. You should use the function in the class

As for traverse the whole link, you should use

cur=dvdlist.head
while cur!=None:
    do_something()
    cur=cur.next
  • Related