https://bong-f.tistory.com/324
print("aA".isalpha()) ##True
list1 = [str1[n:n+2].lower() for n in range(len(str1)-1) if str1[n:n+2].isalpha()]
gyo = set(str1) & set(str2)
hap = set(str1) | set(str2)
def practice():
s1 = set([1, 2, 3, 4, 5, 6])
s2 = set([4, 5, 6, 7, 8, 9])
gyo = set(s1) & set(s2)
gyo2 = set(s1).intersection(s2)
hap = set(s1) | set(s2)
cha = set(s1) - set(s2)
print(gyo) ## {4, 5, 6}
print(gyo2) ## {4, 5, 6}
print(hap) ## {1, 2, 3, 4, 5, 6, 7, 8, 9}
print(cha) ## {1, 2, 3}
public static void makeAnotherSet() {
List<Integer> list1 = Arrays.asList(1, 2, 3, 4);
List<Integer> list2 = Arrays.asList(3, 4, 5, 6);
Set<Integer> gyo = new HashSet<>();
Set<Integer> hap = new HashSet<>();
hap.addAll(list1);
hap.addAll(list2);
gyo.addAll(list1);
gyo.retainAll(list2);
System.out.println(hap); // [1, 2, 3, 4, 5, 6]
System.out.println(gyo); // [3, 4]
}
public class CountOccurrence {
public static void main(String[] args) {
List<Integer> list1 = Arrays.asList(1, 2, 3, 4, 1, 1);
int frequency = Collections.frequency(list1, 1);
System.out.println(frequency); // 3
}
}