Question: Question 2 The coordinates of different persons are given in the following dictionary position=TA: 2,5), B(1,7 C 9.5), 'D': (2.69 You will take 2 inputs

 Question 2 The coordinates of different persons are given in the

Question 2 The coordinates of different persons are given in the following dictionary position=TA: 2,5), B(1,7 C 9.5), 'D': (2.69 You will take 2 inputs for person is location where the first input specifes person Xs current location in the x-axis and the second input specifes person Xs current location in the younds Your work is to in the person closest to person X by calculating the distance between person X and every other person in the dictionary Hint The distance between two coordinates is given by the formula (You need to import maths: math.x112+12-12 Sample Input 1 Enterperson Xs x coordinate: 3 Enterperson Xs y coordinate: 6 Sample Output 1: Explanation Xis (3.6). The distance between person X and person A 2 The distance between person X and person 3:5 The distance between person and person C: 37 The distance between person X and person D: 1 The last distance is between person X and D. So, Dia selected Sample Input Enter person Xs x coordinate: 3 Enterperson Xs y coordinate: 5 Sample Output 2 A Explanation X(3.51 The distance between person X and person A: 1 The distance between person and person 3:22 The distance between person X and person C:6 The distance between person X and person D:2 The last distance is between person X and A. So, Ais selected

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!