[SOLVED] mindistance.py

15.00 $

Programming resource
Digital learning resource
Category: Tag:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (3 votes)

You should save the solution to this problem in a file called mindistance.py if you wish to use the tester program. write a function called mindistance that takes a single 2-dimensional list argument as input. Each of the items in this argument list will be a list with 2 numbers representing the x and y location of a point in 2D space. The function must return the 2-element list representing the x and y location of the point that is closest to the origin (x=0, y=0). You can calculate the distance between a point (x,y) and the origin (0,0) with the equation:√x2+y2 route (x square + y square)

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.