[issue44179] python3 终端 range函数显示错误

Christian Heimes report at bugs.python.org
Wed May 19 08:25:12 EDT 2021


Christian Heimes <lists at cheimes.de> added the comment:

In Python 3 the range() builtin returns an iterator, not a list of items. You have to exhaust the iterator to get a list of iterator items.

>>> list(range(-10, -100, -30))
[-10, -40, -70]

----------
nosy: +christian.heimes
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue44179>
_______________________________________


More information about the Python-bugs-list mailing list