Color mixer

Define a function color_mixer that receives two colors color1 and color2
and returns the color resulting from mixing them in EITHER ORDER.
The colors received are either red, blue, or yellow and you should return:

Magenta if the colors mixed are red and blue

Green if the colors mixed are blue and yellow

Orange if the colors mixed are yellow and red

Examples:

>>> color_mixer('red', 'blue')
'Magenta'
>>> color_mixer('blue', 'red')
'Magenta'
>>> color_mixer('blue', 'yellow')
'Green'
>>> color_mixer('yellow', 'red')
'Orange'

Test Cases

test red blue - Run Test

def test_red_blue():
    assert color_mixer('red', 'blue') == 'Magenta'

test yellow red - Run Test

def test_yellow_red():
    assert color_mixer('yellow', 'red') == 'Orange'

test red yellow - Run Test

def test_red_yellow():
    assert color_mixer('red', 'yellow') == 'Orange'

test blue yellow - Run Test

def test_blue_yellow():
    assert color_mixer('blue', 'yellow') == 'Green'

test yellow blue - Run Test

def test_yellow_blue():
    assert color_mixer('yellow', 'blue') == 'Green'

test blue red - Run Test

def test_blue_red():
    assert color_mixer('blue', 'red') == 'Magenta'

Solution 1

def color_mixer(color1, color2):
    if color1 == 'blue':
        if color2 == 'red':
            return 'Magenta'
        elif color2 == 'yellow':
            return 'Green'
    elif color1 == 'red':
        if color2 == 'yellow':
            return 'Orange'
        elif color2 == 'blue':
            return 'Magenta'
    elif color1 == 'yellow':
        if color2 == 'blue':
            return 'Green'
        elif color2 == 'red':
            return 'Orange'
def color_mixer(color1, color2): pass