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.