MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / distance

Function distance

example_code/item_056.py:59–60  ·  view source on GitHub ↗
(left, right)

Source from the content-addressed store, hash-verified

57
58print("Example 2")
59def distance(left, right):
60 return ((left.x - right.x) ** 2 + (left.y - right.y) ** 2) ** 0.5
61
62origin1 = Point("source", 0, 0)
63point1 = Point("destination", 3, 4)

Callers 2

item_056.pyFile · 0.85
bad_distanceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected