I have a list:

```
['a','b','b','c']
```

to find all occurrences of an element I use:

```
incd=['a','b','b','c']
indeces=[i for i, x in enumerate(incd) if x == 'b']
```

how can I search for two elements and all their positions?

```
w1='a'
w2='b'
indeces=[i for i, x in enumerate(incd) if x == w1|w2]
```

returns

```
TypeError: unsupported operand type(s) for |: 'str' and 'str'
```

and

```
indeces=[i for i, x in enumerate(incd) if x == 'a|b']
```

returns

```
[]
```

both fails

I would like to have returned

```
[0, 1, 2]
```

`pandas`

tagged in here? – DirtyBit Apr 18 at 15:33