Sort Function: <' not supported between instances of 'float' and 'tuple' - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: General Coding Help (https://python-forum.io/forum-8.html) +--- Thread: Sort Function: <' not supported between instances of 'float' and 'tuple' (/thread-33500.html) |
Sort Function: <' not supported between instances of 'float' and 'tuple' - quest - Apr-30-2021 Hello I have this list: 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 RE: Sort Function: <' not supported between instances of 'float' and 'tuple' - Larz60+ - Apr-30-2021
RE: Sort Function: <' not supported between instances of 'float' and 'tuple' - quest - Apr-30-2021 (Apr-30-2021, 12:41 PM)Larz60+ Wrote: it is already working now. Just the data was coming differently from the other function. I corrected the other function so now this structure is working. Btw, I already showed the contents of nextlist at the top!! |