""" Print of Logic tables """ import operator anzahlVariablen = 2 x1 = False x2 = False for index in range(2**anzahlVariablen): print( f"{index} | {x2} {x1} | {x2 and x1} {x2 or x1} {x2 ^ x1}" ) x1 = not x1 if (index + 1) % 2 == 0: x2 = not x2