Sort the different datatypes in the list

  python-3.x

Sort the list which has a set and a nested list.

list1=[1,2,{5,3},[4,6]]

sorted(list1)

TypeError: ‘<‘ not supported between instances of ‘set’ and ‘int’

Source: Python-3x Questions

LEAVE A COMMENT