[Tutor] if and things

elis aeris hunter92383 at gmail.com
Thu Jul 19 03:38:11 CEST 2007


full code below.



#  pixel[]  is a list of tuples:   (r,g,b)
#  pixel[1030*(y-a) + x][0] = r
#  pixel[1030*(y-a) + x][1] = g
#  pixel[1030*(y-a) + x][2] = b

for a in range(0, 10):
    if    pixel[1030*(y-a) + x][1] > pixel[1030*(y-a) + x][0] and
pixel[1030*(y-a) + x][1] > pixel[1030*(y-a) + x][2]:
        box = box + 1

print box


i have never used double conditions before, is this correct?

I want box++ when  the g is both bigger than r and b.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20070719/07b6d93a/attachment.htm 


More information about the Tutor mailing list