is there a better/more pythonic way to do something like this?

spam = ['c','c','v','c','v']

for x in xrange(0,5,2):
    print spam[x], spam[x+1]

There are other things I'll be doing with the values, but I want to get them
in chunks of two. (I realize that this code will throw errors, it's just a
hasty example of what I need)

Thanks,
Wayne

-- 
To be considered stupid and to be told so is more painful than being called
gluttonous, mendacious, violent, lascivious, lazy, cowardly: every weakness,
every vice, has found its defenders, its rhetoric, its ennoblement and
exaltation, but stupidity hasn't. - Primo Levi
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to