Do i have to use try: and except ValueError?
<p>I'm still new to python. 
Do I have to use try: and except ValueError? 
If not when would and should I use them?
Some parts work with and without it
E.g</p>

<pre><code>Def Main_Menu():
    Main_menu_op = input("A.Start \nB.Options \nC.Exit")
    Try:
        if Main_menu_op == "A" or "a":
            Start()

        elif Maim_menu_op == "B" or "b":
            Options()

        elif Main_menu_op == "C" or "c":
            Exit()
    except ValueError:
       print("error")
       Main_menu()
</code></pre>

<p>I just typed this since I'm on my tablet and not my pc so just ignore any mistakes </p>

<p>P.s this is part of a text based game I'm working on </p>

<p>You should only use <code>try</code> and <code>except ...Error</code> (<a href="https://docs.python.org/2.7/tutorial/errors.html" rel="nofollow">documentation</a>) when you know you can safely handle a specific known error.</p>

<p>So if you are expecting a certain error, like a <code>ValueError</code>, you can catch it and handle it instead of having you application crash. Let's say you have a user's input and expect a number:</p>

<pre><code>...
a = raw_input('Please give me a number: ') # input(...) on Python 3.
try:
    number = float(a)
except ValueError:
    print 'You have not given me a valid number, defaulting to 0.'
    number = 0.
# do stuff with number
...
</code></pre>

<p>If you are not expecting an error or are not prepared to handle it (or there's no proper way to handle), you might want to see the error and its trace on the console so you can debug it.</p>

<p>In your example you can use an 'else' to say the command given is not recognised, and ask for another.</p>

python