0
Functions set and sort
What are they doing?
1 Answer
+ 2
âset()â is a function, but âsort()â is a method. âsorted()â is a function. âset()â will return all distinct elements of a list, set etc., for example, if you set([1,2,2,3,3,3]) it will become {1,2,3} since 1, 2 and 3 are the only distinct numbers in this list. âsort()â can be applied to lists and âsorted()â to lists, sets and tuples... (âsorted()â will return a list and âset()â a set) Hereâs how each of them works:
https://code.sololearn.com/cgg0gpmuyHZ6/?ref=app