My professor asked me to simulate Boolean Gates and the output is a truth table
To simulate an n=3 Gates you need 3 for loop
for i in range(0,2):
for j in range(0,2):
for k in range(0,2):
stuff
To simulate an n=2 Gates you need 2 for loop
for i in range(0,2):
for j in range(0,2):
stuff
i wanted to have an an n= user input, so there may be a chance where the user input more than 10 is there a way to automate the loop??
if there's any reference, especially if it uses an oop paradigm, it would be very helpfull Thank you
2**n, if so you can just change the loop range by that equation. unless you use the loop count instuffitertools.product.