TypeError: get() takes no keyword arguments

前端 未结 3 918
后悔当初
后悔当初 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:38

    The error message says that get takes no keyword arguments but you are providing one with default=0

    converted_comments[submission.id] = converted_comments.get(submission.id, 0)
    

提交回复
热议问题