[{' '' '}{' '' '}{' '' '}{' '' '}{' '' '}adding vertex adding vertex is straight forwardwhere we add another additional key to the graph dictionary class graphdef __init__(self,gdict=none)if gdict is nonegdict {self gdict gdict def getvertices(self)return list(self gdict keys()add the vertex as key def addvertex(selfvrtx)if vrtx not in self gdictself gdict[vrtx[create the dictionary with graph elements graph_elements " [" "," "]" [" "" "]" [" "" "]" [" "]" [" " graph(graph_elementsg addvertex(" "print( getvertices()when the above code is executedit produces the following result[' '' '' '' '' ',' '