Trouble with for loop

Ant antroy at gmail.com
Tue Nov 6 05:09:46 EST 2007


On Nov 6, 9:59 am, Shriphani <shripha... at gmail.com> wrote:
...
> My main intention is to state that each of the variables namely a, b,
> c, ## can take value from 1 to 9.
> How do I go about this ?

It sounds like you are after something like:

for var in (a, b, c, d, e, f):
   assert var in [1, 2, 3, 4, 5, 6, 7, 8, 9]

but it's hard to tell without some more information from you on
exactly what you are trying to achieve.




More information about the Python-list mailing list