Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

1 of 4
mabel
  • 1.7k
  • 14
  • 18

Python 3.8 (pre-release), 70 bytes

returns (mean, p_mean, trend)

lambda x:(m:=sum(x)/len(x),([p:=x[0]]+[p:=(p+n)/2for n in x])[-1],p-m)

Try it online!

I know there has to be some more clever tricks to golf this further...

mabel
  • 1.7k
  • 14
  • 18

AltStyle によって変換されたページ (->オリジナル) /