Sets
Sets using curly braces { } Example of a Set : mixed_set = {11, 200, 404, 30, "Python", "JavaScript", 99, "Ruby", "Rust"} Sets are unordered collection of elements, meaning that everytime I run the code the order of the items/elements will be print out randomly mixed_set = {11, 200, 404, 30, "Python", "JavaScript", 99, "Ruby", "Rust"} print(type(mixed_set)) print(mixed_set) Sets don’t allow for duplicate elements duplicates = {11, 11, "python", "ruby", 30, 9, 30, "python"} print(duplicates) If I have a List with some duplicates items I can cast it to a Set to remove them duplicate_list = ["python", "java", "ruby", "java", 300, 9, 9, 300, "python", 1, 10] print(duplicate_list) new_set = set(duplicate_list) print(new_set) Set is optimized for mainly to find information in them and for mathematical operations...