Comparing numbers give the wrong result in Python
<p>sorry if this is a terrible question, but I am really new to programming. I am attempting a short little test program.</p>

<p>If I enter any value less than 24, it does print the "You will be old..." statement. If I enter any value greater than 24 (ONLY up to 99), it prints the "you are old" statement.</p>

<p>The problem is if you enter a value of 100 or greater, it prints the "You will be old before you know it." statement.</p>

<pre><code>print ('What is your name?')
myName = input ()
print ('Hello, ' + myName)
print ('How old are you?, ' + myName)
myAge = input ()
if myAge &gt; ('24'):
     print('You are old, ' + myName)
else:
     print('You will be old before you know it.')
</code></pre>

<pre><code>print ('What is your name?')
myName = input ()
print ('Hello, ' + myName)
print ('How old are you?, ' + myName)
myAge = input ()
if int(myAge) &gt; 24:
     print('You are old, ' + myName)
else:
     print('You will be old before you know it.')
</code></pre>

<p>Just a small thing about your code. You should convert the input from <code>myAge</code> to an integer (<code>int</code>) <em>(number)</em> and then compare that number to the number 24.;</p>

<p>Also, you should usually not add strings together as it is consider <em>non-pythonic</em> and it slow. Try something like <code>print ('Hello, %s' % myName)</code> instead of <code>print ('Hello, ' + myName)</code>.  </p>

<p><a href="https://www.tutorialspoint.com/python/python_strings.htm" rel="nofollow">Python Strings Tutorial</a></p>

python if-statement