Home / Expert Answers / Computer Science / 2-using-python-write-a-function-trafficlight-to-do-the-following-first-it-will-draw-a-simple-t-pa935

(Solved): 2. Using Python, write a function trafficLight() to do the following. First, it will draw a simple t ...



2. Using Python, write a function trafficLight() to do the following. First, it will draw a simple traffic light in a graphics window that is 200 pixels
wide by 200 pixels high. The three lights should have a diameter of 50 pixels each, and the traffic light should be centered in the graphics window. Second, the next mouse click in the window makes the green light green and the other two gray, the click after that makes the yellow light yellow and the other two gray, the click after that makes the red light red and the other two gray. The next mouse click should go back to
green and as long as you keep clicking the light will cycle. 

*you might want if __name__ == "__main__": trafficLight() so you can watch it run



We have an Answer from Expert

View Expert Answer

Expert Answer


We have an Answer from Expert

Buy This Answer $5

Place Order

We Provide Services Across The Globe