how to make every item compare the rest items of list in python

Solutions on MaxInterview for how to make every item compare the rest items of list in python by the best coders in the world