I am trying to append or extend values by using "def" function, but, I am getting an error numpy.float64 object is not iterable
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?
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)