On Thu, 09 Oct 2014 17:57:03 +1300, Gregory Ewing wrote:

> Seymore4Head wrote:
>> I want to toggle between color="Red" and color="Blue"
> 
> toggle = {"Red": "Blue", "Blue": "Red"}
> color = toggle[color]

How about a simple

colour = 'red' if colour == 'blue' else 'blue'



-- 
The light at the end of the tunnel is the headlight of an approaching 
train.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to