May-02-2021, 10:24 AM
Hello
I want to compare string and bool.
Here is my function:
I want to compare string and bool.
Here is my function:
def MyFunction(qbt, Pauli):
if qbt.QEO.state[0]=='Bell':
...
elif qbt.QEO.state==False: qbt.QEO.state=False
else:
raise NotImplementedError("Unknown State")
return qbt.QEO.state However if my state is False, I cannot compare 'Bell' and False and I have this error:Error:Bool Object is not SubscriptableIt is probably because of this line: if qbt.QEO.state[0]=='Bell'If my state is False, then I cannot compare False and 'Bell'. How to solve this error?
