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

4 of 5
replaced http://codegolf.stackexchange.com/ with https://codegolf.stackexchange.com/

Operations with Lists

Inspired by this question.

Given a list containing numbers, print:

  • The sum and product of the numbers in the list
  • The average and median
  • The differences between each term in the list (e.x. [1,2,3] -> [1,1]: 1+1=2, 2+1=3)
  • The list, sorted ascending
  • The minimum and maximum of the list
  • The standard deviation of the list

For reference:

Standard Deviation
Standard Deviation
Where μ is the mean average, xi is the ith term in the list, and N is the length of the list.

Shortest code wins. Good luck!

beary605
  • 4.4k
  • 2
  • 27
  • 53

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