It is not clear if you want to just test for Property A, as in the text, or A or C, as in the title. (C being A and B)
To just get True
or False
for 1 or 3 and not 2, you can use a code rephrasing of your logic:
result = '***' in x or (not '**' in x and '*' in x)
To get the letter of ABC
out depending on the pattern:
result = ['None','A','B','C'][('*' in x) + ('**' in x) + ('***' in x)]
To just test for Property A (one star) without failing on two or three. (EDIT: simplified this. If **
is not there then neither is ***
):
isItA = '*' in x and not '**' in x