Solutions will be available when this assignment is resolved, or after a few failing attempts.

Traffic light

Define a function traffic_light that receives a color and returns:

'stop' if the color is red

'slow down' if the color is yellow

'go' if the color is green


>>> traffic_light('red')
>>> traffic_light('yellow')
'slow down'
>>> traffic_light('green')

Test Cases

test red light - Run Test

def test_red_light():
    assert traffic_light('red') == 'stop'

test yellow light - Run Test

def test_yellow_light():
    assert traffic_light('yellow') == 'slow down'

test green light - Run Test

def test_green_light():
    assert traffic_light('green') == 'go'
def traffic_light(color): pass