Message332597
`input()` returns a string, not a list. For input '1010' you're effectively computing this:
>>> int('1' * 8) + int('1' * 2) # = 11111111 + 11
11111122
which is the correct answer. If you want your input to be a list of integers instead of a string, try, e.g.,
a = input("please enter a binary integer ")
a = list(map(int, a)) |
|
Date |
User |
Action |
Args |
2018-12-27 16:34:43 | scoder | set | recipients:
+ scoder |
2018-12-27 16:34:11 | tim.peters | set | recipients:
+ tim.peters, paul.moore, tim.golden, zach.ware, steve.dower, Fady shehata |
2018-12-27 16:34:06 | tim.peters | set | messageid: <1545928446.82.0.206742839175.issue35597@roundup.psfhosted.org> |
2018-12-27 16:34:06 | tim.peters | link | issue35597 messages |
2018-12-27 16:34:06 | tim.peters | create | |
|