Computer Science, asked by sweetheart7263, 1 year ago

5 points we want to add a function length() to the class node that implements user defined lists of numbers which will compute the length of the list. an incomplete implementation of length() given below. you have to provide an expression to put in place of *** on the last line. you may assume that the quantities stored in node.value can be added using the operator +. def length(self): if self.value == none: return(0) elif self.next == none: return(1) else: return(***)

Answers

Answered by sajin2
0
5 points we want to add a function length() to the class node that implements user defined lists of numbers which will compute the length of the list. an incomplete implementation of length() given below. you have to provide an expression to put in place of *** on the last line. you may assume that the quantities stored in node.value can be added using the operator +. def length(self): if self.value == none: return(0) elif self.next == none: return(1) else: return(***)
Similar questions