AttributeError: can't set attribute in python

前端 未结 3 1253
旧时难觅i
旧时难觅i 2020-12-15 02:35

Here is my code

N = namedtuple(\"N\", [\'ind\', \'set\', \'v\'])
def solve()
    items=[]
    stack=[]
    R = set(range(0,8))
    for i in range(0,8):
              


        
3条回答
  •  一生所求
    2020-12-15 03:01

    items[node.ind] = items[node.ind]._replace(v=node.v)
    

    (Note: Don't be discouraged to use this solution because of the leading underscore in the function _replace. Specifically for namedtuple some functions have leading underscore which is not for indicating they are meant to be "private")

提交回复
热议问题