Question in the description. I beg you all please send me the solution for this please
Write a program that simulates a traffic light. The program should consist of the following: 1. A user defined function trafficLight( ) that accepts input from the user, displays an error message if the user enters anything other than RED,YELLOW, and GREEN. Function light() is called and following is displayed depending upon return value from light(). a) âSTOP, your life is preciousâ if the value returned by light() is 0. b) âPlease WAIT, till the light is Green â if the value returned by light() is 1 c) âGO! Thank you for being patientâ if the value returned by light() is 2. 2. A user defined function light() that accepts a string as input and returns 0 when the input is RED,1 when the input is YELLOW and 2 when the input is GREEN. The input should be passed as an argument. 3. Display â SPEED THRILLS BUT KILLSâ after the function trafficLight( ) is executed.