How can I find the remainder when dividing 2 integers
silverburgh.meryl at gmail.com
silverburgh.meryl at gmail.com
Sun Feb 26 15:28:07 EST 2006
More information about the Python-list mailing list
Sun Feb 26 15:28:07 EST 2006
- Previous message (by thread): How can I find the remainder when dividing 2 integers
- Next message (by thread): How can I find the remainder when dividing 2 integers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
okay, I try you suggestion, and re-write my code like this:
colors = ["#ff0000", "#00FF00", "#0000FF"]
colorIndex = 0
def getText(nodelist):
for str in strings:
print colors[colorIndex % colors.length]
colorIndex += 1
but i get this error:
print colors[colorIndex % colors.length]
UnboundLocalError: local variable 'colorIndex' referenced before
assignment
- Previous message (by thread): How can I find the remainder when dividing 2 integers
- Next message (by thread): How can I find the remainder when dividing 2 integers
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list