title: Python 3: Comparison between strings
body: <p>I want to know something like,</p>
  <pre><code>weeks = '2 Weeks'
  months = '1 Months'
  
  if weeks &lt; months:
      print(f'{weeks} is less than {months}')
  else:
      print(f'{weeks} is greater than {months}')
  </code></pre>
  <p>so in the string, it only compares the numbers in the string. So it is printing &quot;2 Weeks is greater than 1 Month&quot;. If I increase the value from '1 Month' to '3 Months' it then printing &quot;2 Weeks is less than 3 Months&quot;. How can it detect itself to make the correct comparison?</p>