Here's what Ive figured out till now but I'm confused as to what I have to do next.
@d <= lnk.value:
TypeError: '<=' not supported between instances of 'int' and 'LinkNode'
Here's what Ive figured out till now but I'm confused as to what I have to do next.
@d <= lnk.value:
TypeError: '<=' not supported between instances of 'int' and 'LinkNode'
The error:
File "D:/insertionsort.py", line 21, in insert
if lnk == None or val.value <= lnk.value:
TypeError: '<=' not supported between instances of 'int' and 'LinkNode'
Is telling you that when <= gets called, lnk.value is a LinkNode, which
can't be compared with an int (which is what val.value is). In the line:
lnkNew = LinkNode(lnk, insert(val, lnk.rest))
You're setting lnkNew.value to lnk; it should be lnk.value.
LinkNode, you should be using lnk.value to initialise value in lnkNew.