math-multiana/scripts/.ipynb_checkpoints/norms-checkpoint.py

18 lines
259 B
Python
Raw Normal View History

2024-09-12 16:28:12 +02:00
from math import sqrt
def l1(x: list[float]) -> float:
a=0
for i in x:
a+= abs(i)
return a
def l2(x: list[float]) -> float:
a=0
for i in x:
a+= i**2
return sqrt(a)
def li(x: list[float]) -> float:
return max(x)