Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David M. Kroenke, David J. Auer

7th edition

133544621, 133544626, 0-13-354462-1, 978-0133544626

More Books

Students also viewed these Databases questions

Question

How has the Internet changed consumers? Marketers?

Answered: 1 week ago

Question

6. What actions might make employers lose elections?

Answered: 1 week ago