Apr-30-2021, 09:18 AM
Hello I have this list:
nextlist.sort()
TypeError: '<' not supported between instances of 'float' and 'tuple'
HOw to solve it
Output:[((7.2, <__main__.bit object at 0x7f341d8b8700>), <__main__.port object at 0x7f344082cd00>), ((5.5, <__main__.bit object at 0x7f341d8b8790>), <__main__.port object at 0x7f34407aa190>)]
ANd I want to sort it with this code:nextlist=[(next(ip),ip) for ip in ports] while len(nextlist)>0: nextlist.sort()But I have this error:
nextlist.sort()
TypeError: '<' not supported between instances of 'float' and 'tuple'
HOw to solve it