Or... is there a way to select the smallest value in a tuple? I'm sure there is.
Yes, you can use the sorted function on a tuple:
sorted
myTuple = 3, 1, 2 sortedList = sorted(myTuple)
When you use sorted on a tuple, it returns a sorted list of the tuple's elements. Then all you have to do us peel off index 0, as you did above.
[ Home | Post Entry | Log in | Search | Browse Options | Site Map ]
no subject
Yes, you can use the
sorted
function on a tuple:When you use
sorted
on a tuple, it returns a sorted list of the tuple's elements. Then all you have to do us peel off index 0, as you did above.