gpt4 book ai didi

Python 并且不是 None

转载 作者:太空宇宙 更新时间:2023-11-04 06:50:14 25 4
gpt4 key购买 nike

<分区>

我在处理这段代码时遇到了一些问题:

if not fundbenchmark.endswith(("Index", "INDEX")) and fundbenchmark is not None:
fundbenchmark = "%s%s" % (fundbenchmark, " Index")

回溯:

AttributeError: 'NoneType' object has no attribute 'endswith'

显然当 fundbenchmarkNone 时会出现此错误。暗示有问题,fundbenchmark不是None:

我的这个假设是否正确,还是可以在其他地方找到解释?

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com