print('Logische Summe')
print(0 | 0)
print(0 | 1)
print(1 | 0)
print(1 | 1)
print('Logisches UND')
print(0 & 0)
print(0 & 1)
print(1 & 0)
print(1 & 1)
print('Exklusive logische Summe')
print(0 ^ 0)
print(0 ^ 1)
print(1 ^ 0)
print(1 ^ 1)
print('Umkehren')
print(bin(0))
print(bin(~0))
print(bin(1))
print(bin(~1))
print('Verschiebung')
print(bin(1 << 0))
print(bin(1 << 1))
print(bin(1 << 2))
print(bin(1 << 3))
Ausführungsergebnis:
Logische Summe
0
1
1
1
Logisches UND
0
0
0
1
Exklusive logische Summe
0
1
1
0
Umkehren
0b0
-0b1
0b1
-0b10
Verschiebung
0b1
0b10
0b100
0b1000
Recommended Posts