Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I am using Jupyter Lab, please advise where did I go wrong for the below codes. The codes below are unread to read the data
I am using Jupyter Lab, please advise where did I go wrong for the below codes. The codes below are unread to read the data from the cases.
import math
def proximity_p(p, A, B): x_distance = abs(A[0] - B[0])**p y_distance = abs(A[1] - B[1])**p return(x_distance + y_distance)**(1/p)
result = proximity_p(p, A, B) return result
cases= [[1, (-10,20), (20,-30)], [2, (-6,6), (18,-4)], [2, (2,-1,6), (-1,3,-6)], [3, (-3,8,-1,8), (2,2,0,9)], [4, (2,-4,1,0,6),(-2,4,7,4,-2)]]
for p,A,B in cases: print(f"Result: {result:.3f}")
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started