[issue35597] Bug in Python's compiler

Tim Peters report at bugs.python.org
Thu Dec 27 11:50:13 EST 2018


Tim Peters <tim at python.org> added the comment:

Please read my answer again.  Your code does not do what you _think_ it does.  It does what I said it does instead.

>>> a = input()
1010
>>> print(a)
1010
>>> print(type(a))
<class 'str'>

The input you're working with is NOT A LIST OF INTEGERS.  It's a string of "0" and "1" CHARACTERS.

And I already told you how to repair that too:

>>> a = list(map(int, a))
>>> a
[1, 0, 1, 0]
>>> type(a)
<class 'list'>

----------

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


More information about the Python-bugs-list mailing list