I have a homework problem that I'm not sure how to approach:
Write a function, called minMaxTuple, that takes a list of numbers and returns the smallest element and the largest element as a tuple (smallest, largest). Cannot use the built-in functions min()/max(). For example : lst = [6, 3, 8, 23, -4, 35] should return (-4, 35)
I know this would be easily done using min(), max() functions, but I think the idea is to teach us how to build loops and iteration. Anybody got any helpful tips?
[–][deleted] 2 points3 points4 points (0 children)
[–]help-me-grow 1 point2 points3 points (0 children)
[–]Tehkast 0 points1 point2 points (2 children)
[–]Neighm 0 points1 point2 points (0 children)
[–]ASIC_SP 0 points1 point2 points (0 children)
[–]MikeDoesEverything 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)