Created
October 12, 2015 20:43
-
-
Save jadudm/5d0980c8e77ede5d8d44 to your computer and use it in GitHub Desktop.
Exploring parameters in Python, part 1.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def And (a, b, out): | |
if (a and b): | |
out = True | |
else: | |
out = False | |
def main (): | |
tests = [[False, False], [False, True], [True, False], [True, True]] | |
r1 = False | |
r2 = False | |
for test in tests: | |
And(test[0], test[1], r1) | |
print "And(%s, %s) => %s" % \ | |
(test[0], test[1], r1) | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment