gpt4 book ai didi

python - "' NoneType ' object is not iterable"追加列表时出错

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

<分区>

我想添加到列表并在添加更多时按字母顺序排序。这会出现错误:“NoneType”对象不可迭代

   toPrint = []
toPrint = toPrint.append("b")
toPrint = toPrint.append("a")
toPrint = sorted(toPrint)

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