Following along with the live coding video was extremely helpful.

This commit is contained in:
R Marshall Hall 2023-08-18 10:29:09 -04:00
parent a146358a50
commit d975649087
1 changed files with 14 additions and 2 deletions

View File

@ -6,11 +6,23 @@
def maximum(data):
"Returns the largest number in data"
raise NotImplementedError
highest = None
for number in data:
if highest is None:
highest = number
if number > highest:
highest = number
return highest
def minimum(data):
"Returns the smallest number in data"
raise NotImplementedError
lowest = None
for number in data:
if lowest is None:
lowest = number
if number < lowest:
lowest = number
return lowest
def bounds(data):
"Returns a list of the smallest and largest numbers in data"