title: Getting current year in Python
body: <pre><code>import datetime
  today = datetime.datetime.now()
  def bYear():
      age = input("How old are you: ")
      bYear = today.year - age
      print("Born in: " + bYear)
  bYear()
  </code></pre>
  
  <p>I've started learning python a few days ago. Trying some 'stupid' stuff but I can't get this code working. <br /><br />
  If i try to print the year with: </p>
  
  <pre><code>print(today.year)
  </code></pre>
  
  <p>the output is correct.<br /><br /></p>
  
  <p>Error message:</p>
  
  <pre><code>&lt;ipython-input-1-0eeb398a7422&gt; in &lt;module&gt;
        5     bYear = today.year - age
        6     print("Born in: " + bYear)
  ----&gt; 7 bYear()
  
  &lt;ipython-input-1-0eeb398a7422&gt; in bYear()
        3 def bYear():
        4     age = input("How old are you: ")
  ----&gt; 5     bYear = today.year - age
        6     print("Born in: " + bYear)
        7 bYear()
  
  TypeError: unsupported operand type(s) for -: 'int' and 'str'```
  
  Im missing something here, any help?
  </code></pre>