Skip to content

Instantly share code, notes, and snippets.

@jadudm
Created October 12, 2015 20:43
Show Gist options
  • Save jadudm/5d0980c8e77ede5d8d44 to your computer and use it in GitHub Desktop.
Save jadudm/5d0980c8e77ede5d8d44 to your computer and use it in GitHub Desktop.
Exploring parameters in Python, part 1.
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