One of my friend has been asked with a question
Retrieving the max top 100 numbers from one hundred million of numbers
in a rece
Suppose mylist is a list of hundred million data. so we can sort the list and take the last hundred data from mylist.
mylist.sort()
mylist[-100:]
Second way:
import heapq
heapq.nlargest(100, mylist)