How do I return a list of the 3 lowest values in another list. For example I want to get the 3 lowest values of this list:
in_list = [1, 2, 3, 4, 5, 6] inpu
If you could sort,you can get frst 3 elements as below:
alist=[6, 4, 3, 2, 5, 1] sorted(alist)[:3]
Output:
[1,2,3]