method works fine, until it is called in a function, then UnboundLocalError
- by user1776100
I define a method called dist, to calculate the distance between two points which I does it correctly when directly using the method.
However, when I get a function to call it to calculate the distance between two points, I get
UnboundLocalError: local variable 'minkowski_distance' referenced before assignment
edit
sorry, I just realised, this…