Is there some way to make sure that the raw_input is only non-numeric?
<p>I want to make sure that the user enters the input in the correct format and i do know how to make sure its numeric input but i dont understand how to make sure its not numeric input.</p>

<pre><code>x = raw_input('What is your name? ')
y = raw_input('What is your age? ')
try:
    something_to_make_sure_its_not_numeric(x)
    int(y)
    print "Hello {0}, You look very handsome for someone who is {1}.".format(x, y)
except:
    print('please enter input in correct format')
</code></pre>

<p>y question is that is there some function in python like int() that makes sure that it only has letters.</p>

<p>You can use Regular Expressions to do that:</p>

<pre><code>import re
tester = re.match(r'^[a-zA-Z]*$', x)
if tester:
    print x
else:
    print 'Incorrect input'
</code></pre>

<p>If the return of the match method is <code>None</code> then your input does not satisfy your Regular Expression rule. In the example above it only verify if is a single string but you can change your re rule to match naything you want. </p>

<p>You can consult the documentation in <a href="https://docs.python.org/2/library/re.html" rel="nofollow">here</a> for more information about re.</p>

python python-2.7