<p dir="ltr">You have to convert `age` to an integer. Use int() to do it. Then you can compare it to other numbers and obtain the expected results.</p>
<div class="gmail_quote">On 22 May 2013 07:29, "C. N. Desrosiers" <<a href="mailto:cndesrosiers@gmail.com">cndesrosiers@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I'm just starting out with Python and to practice I am trying to write a script that can have a simple conversation with the user.<br>
<br>
When I run the below code, it always ends up printing response to "if age > 18:" -- even if I enter a value below 18.<br>
<br>
Can anyone point me to what I am doing wrong?  Many thanks in advance.<br>
<br>
age=raw_input('Enter your age: ')<br>
if age > 18:<br>
    print ('Wow, %s. You can buy cigarettes.' % age)<br>
else:<br>
    print ('You are a young grasshopper.')<br>
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</blockquote></div>