Відповідь:
array = [
[0, 0, 1],
[0, 1, 1],
[1, 1, 0]
]
variable = []
for i in array:
for m in i:
variable.append(m)
a = variable[0] * variable[1] + variable[2]
b = variable[0] + variable[2]
print('A*B+C = ', a)
print('A + C = ', b)
variable[0] = 0 if not variable[0] else 1
variable[1] = 0 if not variable[1] else 1
print('X = ', a * (variable[0] + variable[1]), '\n')
variable.clear()
Пояснення:
Відповідь:
array = [
[0, 0, 1],
[0, 1, 1],
[1, 1, 0]
]
variable = []
for i in array:
for m in i:
variable.append(m)
a = variable[0] * variable[1] + variable[2]
b = variable[0] + variable[2]
print('A*B+C = ', a)
print('A + C = ', b)
variable[0] = 0 if not variable[0] else 1
variable[1] = 0 if not variable[1] else 1
print('X = ', a * (variable[0] + variable[1]), '\n')
variable.clear()
Пояснення: