0

I have class which has int number as member like

class MyObj:
    __init__(self,num):
        self.num = num

then, I have list of this MyObjs

myList = [MyObj(10),MyObj(4)]

I want to sort with myObj.num

then result should be [MyObj(4),MyObj(10)]

I am checking sort and ksort however still in vague.

Could you give some hint or Is it possible??

whitebear
  • 8,922
  • 18
  • 81
  • 171

0 Answers0