I have an array:
array = ['wood', 'glass', 'metal', 'glass', 'glass', 'wood', 'metal', 'wood', 'glass', 'glass']
and I want to replace each string by a condition, for example: each 'wood' replace by 'blue', 'glass' by 'red' and 'metal' by 'green'.
so I get:
['blue', 'red', 'green', 'red', 'red', 'blue', 'green', 'blue', 'red', 'red']
I'm trying to do something like:
['red' if el == 'glass' for el in array]
I don't know how to do multiple conditions or even if this method is the right thing to do?
please help :)