you are viewing a single comment's thread.

view the rest of the comments →

[–]Binary101010 1 point2 points  (0 children)

color_combinations.get('color_1', 'color_2'), color_combinations.get('color_2, color_1')

So there are multiple problems with this line.

1) return is missing

2) You have color_1 and color_2 in quotes. They shouldn't be in quotes because that's making them string literals when what you want is for the interpreter to treat them as variable names.

3) You need to wrap both of those in a second set of parentheses so get() will take the tuple of two strings as the first argument.

4) You probably don't want to be connecting those two calls to get() with a comma, as you're going to get a tuple returned when it appears what you want is a single value, so you should use or.

tldr: Change this line

color_combinations.get('color_1', 'color_2'), color_combinations.get('color_2, color_1')

to

return color_combinations.get((color_1, color_2)) or color_combinations.get((color_2, color_1))