title: Year to Century Function Code Understanding
body: <p>Given a year, return the century it is in. The first century spans from the year 1 up to and including the year 100, the second - from the year 101 up to and including the year 200.  For year = 1905, the output should be centuryFromYear(year) = 20. For year = 1700, the output should be centuryFromYear(year) = 17.</p>
  
  <p>Solution:</p>
  
  <pre><code>def centuryFromYear(year):
      if year % 100 == 0:
          return year/100
      else:
          return int(year/100) + 1
  </code></pre>
  
  <p>I tried the following code:</p>
  
  <pre><code>def centuryFromYea(year):
      return year % 100
  </code></pre>
  
  <p>I tried other solutions and received errors. I need an explanation on why the if statement is set to equals to 0 and if true return to year/100. I also need an explanation on the else return.</p>