Given a nested list of points and locations (x,y): pointlist = [[[-174.6, 52], 'A'], [[-152, 58], 'B'], [[-166.1, 53], 'C']],[[90, -179.7], 'D']]
I need help creating a code that will tell if a point is between a user inputted xmax, xmin, ymax, ymin. If a point from the pointlist is in the range of both the xmax-xmin and ymax-ymin values then the code needs to print the name or names of the point or points included.
The format of the data list is pointlist= [[x value, y value], 'point name']
I have defined the variables that the user will input:
xmax = float(input("Enter a maximum x value:"))
xmin = float(input("Enter a minimum x value:"))
ymax = float(input("Enter a maximum y value:"))
ymin = float(input("Enter a minimum y value:"))
I know I need to use If and For statements, and => and <= but I am not sure how to relate that with the negative values involved in the data set. Our teacher wants to be able to use this code on a bigger data set. The one she gave us above is just a small sample size for practice.