n = len({1, 2, 3}) # n = 3 or myset = set() myset.add(1) myset.add(2) myset.add(3) len(set1) # len(set1) = 3