[Tutor] solution for for loop?

Clayton Kirkwood crk at godblessthe.us
Sat Oct 25 05:17:59 CEST 2014


description_string=code_string=''

description = code = 'a'

for (description_position, code_position) in (description, code):

    print(description_position,code_position)

 

I have tried variations on this for statement, and it doesn't work:<))) Both
description and code have the same size array. I was hoping that some
derivative of this for would bring in a new description_position value, and
code_position value.

Amongst various trials I have tried dp in d && cp in c; dp, cp in d,c. etc.

 

This is the error report:

Traceback (most recent call last):

  File "C:/Users/Dad/python/stock tracker/raw yahoo scraper codes.py", line
80, in <module>

    for (description_position, code_position) in (description, code):

ValueError: too many values to unpack (expected 2)

 

Is there something like what I want?

 

Thanks,

 

CLayton

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20141024/d5317b94/attachment.html>


More information about the Tutor mailing list