hi guys,
i would like to learn how to make "OR" function in sentence below:
My goal is to get returned Blue if found substring "Blue" or "blue" in string
i tried to do:
but it doesn't work
#edit
I figured it out:
i would like to learn how to make "OR" function in sentence below:
My goal is to get returned Blue if found substring "Blue" or "blue" in string
1 |
color = "Blue" if 'blue' in description else "yellow" |
1 |
color = "Blue" if 'blue' or 'Blue' in description else "yellow" |
#edit
I figured it out:
1 |
color = "Blue" if 'Blue' in description or "blue" in description else "yellow" |