Question

2. (Two-way Traffic light) Expanding on your solution for

problem 1, develop a python that simulates a two traffic

lights (North-South and West-East. Configure the lights for

the following sequence:

a. When the light is green in North-South side, the light

in the West-East is red.

b. When the light turns yellow in North-South side, the

light in the West-East side is still red.

c. When the light in North-South turns red, the light in

West-East becomes green.

d. The sequence for each light is green (5 seconds),

yellow (1 second), and red (5 seconds)

e. Verify that the N/S and E/W are not both green at the

same time!

f. The process should loop indefinitely until you stop the

program.

Question image 1