title: write a function (recursive) that will calculate the sum of even numbers from 1 to n
body: <p>I have to write a recursive function that will calculate the sum of even numbers from 1 to n.
  for example for <code>n=input= 6</code> the expected <code>output would be: 2+4+6 = 12</code></p>
  <pre><code>def sum_of_even(n):
      if not n % 2 == 0:
          return n
      else:
          return n + sum_of_even(n-1)
  
  
  print(sum_of_even(6))
  </code></pre>
  <p>this gives output 11, but I don't  even know if my concept is right</p>