Explore Library
Code QuizIntermediate

L2 Vector Norm

Spot the missing operation that leaves this L2 norm returning a squared value.

Codepython
import math

def l2_norm(v):
    # Euclidean (L2) norm
    return sum(x**2 for x in v)

print(l2_norm([3, 4]))  # expected 5.0

What is the bug in this L2 norm function?