gpt4 book ai didi

python - 如何从迭代器对象中获取数字。 (Python2.7)

转载 作者:行者123 更新时间:2023-12-05 08:27:29 24 4
gpt4 key购买 nike

<分区>

方法返回迭代器对象。我想检查要测试的数据数量。

我认为这是一个简单的问题,但我无法解决。

    records = a_function()
self.assertEqual(1, len(records)) # TypeError: object of type 'listiterator' has no len()

Python2.7

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