Python: Vector Class: math.hypot()
import math class Vector: def __init__(self, x, y): self.x = x self.y = y def length(self): return math.hypot(self.x, self.y) v = Vector(3, 4) print(v.length()) # 5.0