I have been doing a challenge to find a runner up score from a list
or
You can say I was trying to find the second largest from a list.
array = '57 57 -57 57'
print(list(set(sorted(array.split(' '))))[-2])
But on every execution the program returning different Output.
- On first execution it returned
57
- On Second execution it returned
-57
- On Third, Fourth, Fifth, Sixth, Seventh execution it returned
57
- Again on Eigth execution it again returned
-57
Why it is behaving like this??