>   >>> def ifthen(p,q):
>           return (not p) or q
> 
> i.e. (~p | q) <-> (p -> q)
> 
>   >>> combos = ((True,True),(True,False),(False,True),(False,False))
> 
>   >>> for p,q in combos:
>            print "Inputs:  %s\t%s\tOutput: %s" % (p, q, ifthen(p,q) )
> 
>   Inputs:  True         True  Output: True
>   Inputs:  True         False Output: False
>   Inputs:  False        True  Output: True
>   Inputs:  False        False Output: True
> 
> 
> Kirby

On more quickie regarding 'functions':  I've got these integrated into a
curriculum outline here:  http://www.4dsolutions.net/ocn/mainoutline.html
You'll see it's pretty traditional, but the context is clearly influenced by
computer science.  I haven't touched this document since Oct 9, 2003 but
still consider it current enough to be useful in the field.

Kirby


_______________________________________________
Edu-sig mailing list
[EMAIL PROTECTED]
http://mail.python.org/mailman/listinfo/edu-sig

Reply via email to