Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
例如:
if l.index(a)== -1: l += [a]
如果我运行这样的东西,我会得到一个值错误。我假设这不是一个新问题。
为什么不直接使用:
if a not in some_list: some_list.append(a)