I am doing a simple check in python to see if a substring is contained within a bigger string. My code looks like this:
def check_product_group(product: str) -> str:
if "CORE" or "Core" in product:
return "CORE"
elif "CASUAL" or "Casual" in product:
return "CASUAL"
else:
return ""
I am passing in the string "Casual_Attire" to the check_product_group function and it keeps returning "CORE" even though "Casual_Attire" does not contain "CORE" or "Core" in it. It should return "CASUAL." I'm confused as to why this is happening. Would appreciate if someone could explain why this is happening.
Thanks!