I struggle to understand the following code, how can add() apply to the set in the following dictionary:
for word in tokenize(name):
index.setdefault(word, set()).add(char)
"add()" is method of set and not a method of dictionary. So how can it be that is adding values to the set in a dictionary?
how can the method .add(char) be