Python Forum

Full Version: AttributeError: module 'string' has no attribute 'uppercase'
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
At last I read the whole assignment and now I see you did exactly what you should do. Thumbs Up
And indeed you need to delete certain items from the dictionary afterwards. But you cannot delete them in the same loop. So the solution would be to fill a list of the keys that need to be deleted in the loop "for word, count in freq.items():".
After that loop you start a new loop over the "to_be_deleted" list. In that loop you can delete the items from the dictionary.
Pages: 1 2