title: sum variable in a range (python)
body: <p>This was the question:</p>
  
  <blockquote>
    <p>Write a function called sum_range that accepts 2 integer values as
    parameters and returns the sum of all the integers between the two
    values, including the first and last values. The parameters may be in
    any order (i.e. the second parameter may be smaller than the first).
    For example:</p>
    
    <p>result = sum_range(1, 1) 
    print(result) 1</p>
    
    <p>result = sum_range(2, 4)    print(result) 9</p>
    
    <p>result = sum_range(3, 2)
    print(result) 5</p>
  </blockquote>
  
  <p>my codes are as below, I dont know where it went wrong
  but when I test the codes, it returned 'none' when (2,4) (3,2) were entered </p>
  
  <pre><code>def sum_range(x,y):
      if x == y:
          return x
  
      if x&lt;y:
          sum(range(x,y))
          return
      if x&gt;y:
          sum(range(y,x))
          return
  </code></pre>