TypeError: get() takes no keyword arguments

前端 未结 3 895
后悔当初
后悔当初 2020-12-05 06:05

I\'m new at Python, and I\'m trying to basically make a hash table that checks if a key points to a value in the table, and if not, initializes it to an empty array. The off

3条回答
  •  醉梦人生
    2020-12-05 06:42

    Many docs and tutorials, for instance https://www.tutorialspoint.com/python/dictionary_get.htm, erroneously specify the syntax as

    dict.get(key, default = None)

    instead of

    dict.get(key, default)

提交回复
热议问题