title: "How to use append or extend function using def function in python?"
body: <p>I am trying to append or extend values by using "def" function, but, I am getting an error <code>numpy.float64 object is not iterable</code></p>
  
  <p>Basically, I want to store different slopes values in the variable name "all_slope" by using extend or append function. I am passing four different values in call function that is a slope. Would, it possible to help me? </p>
  
  <pre><code>all_slope=[]
  def slope(x1,x2,y1,y2):
      x=x2-x1
      y=y2-y1
      slope_value=(y/x)
      all_slope.extend(slope_value)
      return all_slope
  slope(3,2,4,2)
  </code></pre>