【发布时间】:2021-09-01 13:07:33
【问题描述】:
def gen_p():
psmi = 5
psma = 10
ch_v = string.digits + string.ascii_letters + string.punctuation
passc = "".join(choice(ch_v) for x in range(randint(psmi, psma)))
passe.insert(0, passc)
当我想在我得到的 python 条目中显示响应时,python 代码有问题:
AttributeError: 'NoneType' 对象没有属性 'insert'
我正在查找代码中的错误,但找不到。
【问题讨论】:
-
passe未定义!是清单吗?所以在你的 for 循环之前,你可能有passe = [] -
Je ne peux pas car passe est une variable que j'ai attribué à une Entry
-
@Théophile 请使用英语。
-
这告诉您
passe设置为None。你需要向我们展示你是如何定义passe的。
标签: python