Код: Выделить всё
mult = x or y
# Assuming python considers something
# being "0" as false and something being 1 or higher
# (or -1 and lower) as true
mult = (x/x) or (y/y)
# This is in the case Python doesn't do what was
# described above
draw(x, y, 0, 255, 0, 255*mult)
# draw(x_pos, y_pos, red, green, blue, alpha)
Я, вероятно, мог бы проверить это и в свое время, но мне кажется, что я спрашиваю кого-то, кто знает, как компьютеры будут работать со сравнениями, а не с тем, могут ли утверждения быть наиболее полезными.
Подробнее здесь: https://stackoverflow.com/questions/769 ... ent-faster