Python solution for Calculate Distance.