def table_verite_2bits(fonctionbool):
print('|{:^10}|{:^10}|{:^15}|'.format('a','b',fonctionbool.__name__+'(a,b)'))
for a in [True, False]:
for b in [True, False]:
print('|{:^10}|{:^10}|{:^15}|'.format(int(a), int(b), int(fonction(bool(a),bool(b)))))
table_verite_2bits(bool.__or__)
| a | b | __or__(a,b) | | 1 | 1 | 1 | | 1 | 0 | 1 | | 0 | 1 | 1 | | 0 | 0 | 0 |