I am trying to check how many neighbours are there in the graph in the networkx object.
neighbours = nxobject.neighbors('Something')
print(len(neighbours))
Error:
TypeError: object of type 'dict_keyiterator' has no len()
It works with print(len(list(neighbours))) but a new problem arises:
print(len(list(neighbours)))
for child in neighbours:
#Do some work
return Done_work
return None
Now, I'm getting this error:
TypeError: 'NoneType' object is not subscriptable