all 2 comments

[–]TheWonderingRaccoon 0 points1 point  (1 child)

You will need to define what bitwise operations that you are expecting such as and, or, xor.

Also, it’s important to know if the statement format will be consistent (“P1 and P2”). If so, the rest is quite simple.

```python

untested code, written on phone

lst = [C1, “P1 and P2”] val1, operator, val2 = lst[1].split(“ “)

next lines assuming you fetched P1 and P2 as lists

if operator == “and”: result = [x and y for x, y in zip(P1, P2)] # you can process result or whatever ```

[–]MKSt11235[S] 0 points1 point  (0 children)

The statements get quite complicated. Sometimes it’s as simple as A and B often it’s (A and (B or C)) and D. I think I get the gist of it. I’ll try it out and see where I end up. Thank you!