Suppose two tuples are having 2 elements in both of them.
t1=(2,8)
t2=(5,6)
and suppose I want to compare both the tuple on the basis of the first element of both of them.
So, when we do t1>t2
then the output should be True (as t1[1]>t2[1]).
so I want to make a comparison between these two tuples on the basis of first element.
I know that I have to override the compare function of tuple. But I don't know how to do it.
So please tell me how can I do that? (Suppose I want to compare the elements in ascending order...)
The reason I want to do that is : Merging k sorted lists using heapq module in python3
I am using Python-3.8.5