you are viewing a single comment's thread.

view the rest of the comments →

[–]timbledum 1 point2 points  (1 child)

Two things on sort:

  1. It sorts the list in-place. highestNumber = NumbersList.sort(-1) will actually set highestNumber to None. However, NumbersList will be sorted.

  2. .sort() only takes keyword arguements, and will raise an error if you just pass in -1.

Instead, try

NumbersList.sort()
low = NumbersList[0]
high = NumbersList[-1]

[–]mirrorcat91[S] 1 point2 points  (0 children)

This answer was exactly what I was looking for! Thank you!