Hello! You pass to getingc1() "domain ontologies" as an argument. Print c1 before the return statement to see what is going out. You get a single list with a single value ' domain'.
So you get an empty container from which you return 'v'. In the end the returned value from
In [9]: mystr = ['domain', 'ontologies'] In [10]: c1 = [] In [11]: for i in mystr[:1]: ...: c1.append(i) ...: In [12]: c1 Out[12]: ['domain']So in
frequency1()
you count for a string which is not in 'd'.In [20]: print(termslist) dict_items([])
So you get an empty container from which you return 'v'. In the end the returned value from
frequency1
function is None. You can't divide None with something else.