I have the following situation:
string = "abc"
if (string[1] == "b" and string[2] == "c") or (string[1] == "c" and string[2] == "b"):
print("ERROR")
Is there a solution to shorten this in a pythonic way?
I see that (string[1] == "b" and string[2] == "c")
is the reverse statement of (string[1] == "c" and string[2] == "b")
. Maybe I can use that?