Convert the whole list into a list of sets in Python
Given a list of elements p, the task is to convert the whole list into a list of sets. Examples: Input: p = [‘apple’, ‘banana’, ‘cherry’] Output: [{‘apple’}, {‘banana’}, {‘cherry’}] Explanation : Here each element of the list is converted into a set. Input: p = [1, 2, 3, 4] Output: [{1}, {2}, {3}, {4}] Approach : Initialize… Read More »
