Mar-05-2019, 03:14 PM
When you delete the head node, you are setting self.head, not self.headval.
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.
(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
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures