Python Forum
Not Able To Delete First Node From Python Linked List
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Not Able To Delete First Node From Python Linked List
#9
When you delete the head node, you are setting self.head, not self.headval.

(Mar-04-2019, 09:38 PM)ribena1980 Wrote: Thanks ichabod801, I take your point about __init__ but is that likely to be a factor in this instance?

Not a problem in this case, just general programming critique. The other thing I forgot to mention is that you are mixing your interface and your data, which is a good thing to avoid. That is, your list is asking the user questions. That means that you can't create a list without a user. So when you insert a value, the insertFoo methods should take the value as a parameter. The interface should be where the user is asked for a value, and the interface should pass the value to the method.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
Reply


Messages In This Thread
RE: Not Able To Delete First Node From Python Linked List - by ichabod801 - Mar-05-2019, 03:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Delete strings from a list to create a new only number list Dvdscot 8 1,466 May-01-2023, 09:06 PM
Last Post: deanhystad
  Node Flow Generation in Python Linenloid 0 630 Feb-21-2023, 07:09 PM
Last Post: Linenloid
  Python Split json into separate json based on node value CzarR 1 5,476 Jul-08-2022, 07:55 PM
Last Post: Larz60+
  DELETE Post using Python FaceBook Graph API BIG_PESH 0 1,423 Mar-24-2022, 08:28 PM
Last Post: BIG_PESH
  About linked lists ManoEl 2 1,570 Oct-17-2021, 03:21 PM
Last Post: ManoEl
  Delete list while iterating shantanu97 1 1,866 Jun-06-2021, 11:59 AM
Last Post: Yoriz
  I cannot delete and the elements from the list quest 4 2,940 May-11-2021, 12:01 PM
Last Post: perfringo
Star --- Python lists and Linked Lists --- sabe 3 2,648 Nov-22-2020, 05:51 PM
Last Post: DeaD_EyE
  How to create a linked list and call it? loves 12 4,389 Nov-22-2020, 03:50 PM
Last Post: loves
  reference in pop function for linked list oloap 0 1,542 Mar-14-2020, 05:52 PM
Last Post: oloap

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020