18 lines
259 B
Python
18 lines
259 B
Python
|
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)
|