def counter(message):
if 'dos' or '2' in message:
return 2
elif 'tres' or '3' in message:
return 3
elif 'cuatro' or '4' in message:
return 4
elif 'cinco' or '5' in message:
return 5
else:
return 1
I've wrote this function for to know if there's any number in the text in order to know how many of the same product does the user want, and for some reason it's only returning 2.
If I write it with each statement in parenthesis ( if ('dos' or '2') in message:
) it always returns 1.
It's doing it even when '2' or 'dos'
is not in the text.
I've even tried '3' or '4' as the input and it still returns 2
Any idea why this is happening?