Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def more(item1, item2):
- # item1 > item2
- if item1[0] > item2[0]:
- return True
- elif item1[0] == item2[0]:
- if item1[1] > item2[1]:
- return True
- return False
- def sorter(massive):
- for i in range(len(massive)):
- for j in (range(len(massive)- i -1)):
- if more(massive[j], massive[j+1]):
- massive[j], massive[j + 1] = massive[j + 1], mas[j]
- mas = [[3,1],[1,2],[1,3],[2,2],[2,1],[3,2],[2,2],[1,-1]]
- sorter(mas)
- print(mas)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement