. Advertisement .
..3..
. Advertisement .
..4..
I still get the ”typeerror: zip argument #1 must support iteration” error when I run my program.
>>> price = str(u'12.3456')
>>> bids = ['1.0', '2.0']
>>> zip(float(price), bids)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: zip argument #1 must support iteration
I don’t know how to fix the error. Can you give me some advice?
The cause: I think you get the error because of the expression
zip(float(price), Bids)
Solution: You should useitertools.repeat()
in the first argument expression to make tuples combiningfloat(price)
with each element of the arrayBids