Hello. I am trying to show that the rules of truth tables are the same in programming. I already showed "not", "and", and "or"....how can I prove in python the conditional? (I can with some cases, but not all).
I wrote this program: def numero(x): if x>0: return x%2==0 But I can't show that truth table is correct for this...
unless the truth table of conditional of logic is not the same than in programming...
Well, you would normally just use a truth table to find out what was going to happen if needed. But in programs you generally break things down to very small, simple parts. Here is a part from a book on the Python versions of truth tables... or basic logic operators: http://learnpythonthehardway.org/book/ex27.html
Thanks...
Join our real-time social learning platform and learn together with your friends!