Skip to content

Instantly share code, notes, and snippets.

@mauricioaniche
Last active September 19, 2019 09:44
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 mauricioaniche/9735db28d7091dac0f701daca327313a to your computer and use it in GitHub Desktop.
Save mauricioaniche/9735db28d7091dac0f701daca327313a to your computer and use it in GitHub Desktop.
def find(nums):
smallest = 9999
highest = -9999
for num in nums:
if num < smallest:
smallest = num
if num > highest:
highest = num
return smallest, highest
from find import find
def test_decreasing_order():
min, max = find([29, 28, 27, 26])
assert min == 26
assert max == 29
def test_single_number():
result = find([15])
assert min == 15
assert max == 15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment