My code generates the following error: TypeError: object() takes no parameters
class Graph(object): def vertices(self): return list(self.__graph_dict.keys()) if __name__ == "__main__": g = { "a" : ["d"], "b" : ["c"], "c" : ["b", "c", "d", "e"], "d" : ["a", "c"], "e" : ["c"], "f" : [] } graph = Graph(g) print("Vertices of graph:") print(graph.vertices())
Is there any way to solve this?
source share