using sort() You can sort the set by using sort() function. It will sort the set. You can see this in below example :set1 = [{8,6,4,7,9,}] set1.sort() print(set1)Output :[{4, 6, 7, 8, 9}] Thus sort the set by just using sort().