Is there an easier way to do the following without me having to write out outputbodypixel == everytime
? Ideally I want to pull the data from a list where I can just add #ebebeb
, #ececec
, #212121
.
if(outputbodypixel == "#356044" or outputbodypixel == "#22402b" or
outputbodypixel == "#213f2c" or outputbodypixel == "#356043" or
outputbodypixel == "#22402c" or outputbodypixel == "#346044"):
output_body = "green"
elif(outputbodypixel == "#7c3d15" or outputbodypixel == "#493613" or
outputbodypixel == "#4a3612" or outputbodypixel == "#6a553e" or
outputbodypixel == "#785735" or outputbodypixel == "#5e4b37" or
outputbodypixel == "#6a553e" or outputbodypixel == "#86623c" or
outputbodypixel == "#8b4f0d" or outputbodypixel == "#7c3d14" or
outputbodypixel == "#6a553d" or outputbodypixel == "#7c3d14" or
outputbodypixel == "#6a553d" or outputbodypixel == "#7c3d14" or
outputbodypixel == "#87623c" or outputbodypixel == "#6e3612" or
outputbodypixel == "#87613c"):
output_body = "brown"
elif(outputbodypixel == "#8b8b8a" or outputbodypixel == "#8b8b8b" or
outputbodypixel == "#8b8a8b"):
output_body = "silver"
else:
output_body = "NOT DEFINED"
I'm using Python 3.x.