Convert set to list Python
Ngày đăng:
23/12/2021
Trả lời:
0
Lượt xem:
86
In this tutorial, we will see how to convert list to set. As Set does not allow duplicates, when you convert list to set, all duplicates will be removed in the set. Lets understand with the help of example.
Output: List of Students: [Mohan, John, Ramesh, Mohan, John] Set of uniqueNames: {John, Ramesh, Mohan} List of Makrs: [8, 7, 6, 7, 8, 8, 7, 6, 7, 8, 9] Set of marks: {8, 9, 6, 7} As you can see, set starts with open curly braces and ends with close with braces. |