1er
This commit is contained in:
@@ -0,0 +1 @@
|
||||
"""Services utilitaires côté backend."""
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
def price_trend(prices: list[float]) -> str:
|
||||
if not prices:
|
||||
return "stable"
|
||||
first, last = prices[0], prices[-1]
|
||||
if last > first:
|
||||
return "up"
|
||||
if last < first:
|
||||
return "down"
|
||||
return "stable"
|
||||
Reference in New Issue
Block a user