a guest Jan 28th, 2020 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- def index(self, x):
- Returns the first index i in the linked list, where the value x is found. Returns None if none of the Cells
- has a value of x.
- The first element in the linked list has the index 0.
- def indx(cell, n):
- if cell.value == x:
- return n
- elif cell.is_empty:
- return None
- return indx(cell.tail, n + 1)
- return indx(self, 0)
RAW Paste Data