a guest Jan 28th, 2020 55 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 not cell.is_empty:
- return None
- if cell.value == x:
- return n
- return indx(cell.tail, n + 1)
- return indx(self, 0)
RAW Paste Data