Can anyone help me with the following problem?
I have a previous function that returns a dictionary. Now I need this function to make a new one, but I need to do something with the dictionary. To show you what I'm trying to do, dictionary(fasta_filename) is my previous function;
def test(fasta_filename, minMW, maxMW):
interval = minMW, maxMW
for key, value in dictionary(fasta_filename).items():
if value in interval:
print(key)
else:
print('intervals do not match')
This is just starting to try what I want to do, but the main problem I have is that the things you can do with a dictionary, like the .items(), are not working if you try to do it on the function. The error says: 'NoneType' object has no attribute 'items'. I understand this error, because when you do function.items() you assume the function IS the dictionary, but it's not.
I'm still very new to all this, perhaps you can tell, but I would appreciate it if someone could give me a hint. :)