code: def degree(self, vertex):
          
          try:
              return len(self.vertices[vertex])
          except KeyError:
              raise GraphInsertError("Vertex %s doesn't exist." % (vertex,))
docs: Return the degree of a vertex