Skip to content

Instantly share code, notes, and snippets.

@Tevinthuku
Created January 30, 2019 04:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tevinthuku/acd9a91298304b927491879d3c8c6894 to your computer and use it in GitHub Desktop.
Save Tevinthuku/acd9a91298304b927491879d3c8c6894 to your computer and use it in GitHub Desktop.
Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 integers. No floats or empty arrays will be passed.
def sum_two_smallest_numbers(numbers):
return sum(sorted(numbers)[:2])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment