def singlelink(list1, list2):
print(list1)
print(list2)
shortest = sys.float_info.max
dist = 0.0
for x1,y1 in list1:
for x2,y2 in list2:
dist = math.sqrt((float(x1)-float(x2))**2.0 + (float(y1)-float(y2))**2.0)
if dist < shortest:
shortest = dist
return shortest
I call the preceding function using the following
print(singlelink(['51.5217', '30.1140'], ['27.9698', '27.0568']))
When I do this, I get a ValueError: too many values to unpack (expected 2).
Each list only has two values, so unclear why it doesn't just unpack them into the variables