F. len(L): returns the number of objects in mylist.

From EECS 182
F. len(L): returns the number of objects in mylist.
Jump to: navigation, search
  1. best to solve recursively. The answer is trivial if the mylist object is empty.

def len(L):

   if (L.isempty()):
       return 0
   else:
       return len(L.pop()) + 1
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox
EECS @ UM
Tools