<p>I have this code:</p>

<pre><code>chars = #some list

try:
    indx = chars.index(chars)
except ValueError:
    #doSomething
else:
   #doSomethingElse
</code></pre>

<p>I want to be able to do this because I don't like knowfully causing Exceptions:</p>

<pre><code>chars = #some list

indx = chars.index(chars)

if indx == -1:
    #doSomething
else:
   #doSomethingElse
</code></pre>

<p>Is there a way I can do this?</p>

```
```
if element in mylist:
    index = mylist.index(element)
    # ... do something
else:
    # ... do something else
```
```