Question: RESTRICTION: You may not use the Python built-in function you are implementing within its own implementation. In the absence of additional restrictions, you may use
RESTRICTION: You may not use the Python built-in function you are implementing within its own implementation. In the absence of additional restrictions, you may use other Python built-in functions and methods. If given a list or sequence as input, you must not change the original list or sequence.

set() Write a function set(aList) that models a limited version of the behavior of the built-in function. In Python, set() returns a set object - set is a specic type that is different to the list type. Input: a list aList. Output: a list that contains the set of elements in aList (i.e.aList with duplicates removed). It is not important to preserve order. sorted () Write a function sorted(seq) that models a limited version of the behavior of the builtin function. Input: a sequence seq. Output: a list comprising the elements of seq in sorted order (i.e. for for all items in the returned list, the item at index i is less than or equal to the item at index i + 1). Note: Remember that a sequence can be a list, a string, a tuple, or a range, so this function must work for all these types
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
