Question: Please Help me. solve it as soon as possible by using python 3. The coordinates of different persons are given in the following dictionary. =

Please Help me. solve it as soon as possible by using python 3.

Please Help me. solve it as soon as possible by using python

The coordinates of different persons are given in the following dictionary. = position = {'A': (2, 5), 'B': (1, 7), 'C': (9,5), 'D': (2, 6)} You will take 2 inputs for person X's location where the first input specifies person X's current location in the x-axis and the second input specifies person X's current location in the y-axis. Your work is to find 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 math): math.sqrt((x2 - X1)**2 + (y2 - y1)**2) - Sample Input 1: Enter person X's x coordinate: 3 Enter person X's y coordinate: 6 Sample Output 1: D Explanation 1: X is at (3,6). The distance between person X and person A: 2 The distance between person X and person B: 5 The distance between person X and person C: 37 The distance between person X and person D: 1

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!