Python 3 fails and I can't see why.
Go to solution
Solved by vlads_,
dic.get([words[1], 0])
on your 5th line should be
dic.get(words[1], 0)
Instead of calling get with 2 arguments: the key to use (words[1]) and the default value if the key is not found (0), you are calling get with one argument: a new list with these 2 elements. Python tries to use it as a key, but it fails, which is what it's complaining about.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now