List as an item in a set is giving error





list as an item in set gives error


If you instead want to add the entire list as a single element to the set, you can’t because lists aren’t hashable

1 Like

set is a data type which contains only integer as well as floating values so in this set1={1,2,[2,4]} here your inserting list and that is not possible because set is unordered type of collection.