2017-02-27 | Paul Boddie | file changeset files shortlog | Introduced results for other logical operations, refining common behaviour. |
paul@631 | 1 | a = 1 |
paul@631 | 2 | b = 2 |
paul@631 | 3 | c = a and b |
paul@631 | 4 | print c # 2 |
paul@631 | 5 | |
paul@631 | 6 | d = a or b |
paul@631 | 7 | print d # 1 |
paul@631 | 8 | |
paul@631 | 9 | e = not a |
paul@631 | 10 | print e # False |
paul@631 | 11 | |
paul@631 | 12 | if a and b: |
paul@631 | 13 | print "a and b" # a and b |
paul@631 | 14 | |
paul@631 | 15 | if not (a and b): |
paul@631 | 16 | print "not (a and b)" # |
paul@631 | 17 | |
paul@631 | 18 | if not not (a and b): |
paul@631 | 19 | print "not not (a and b)" # not not (a and b) |
paul@631 | 20 | |
paul@631 | 21 | if a or b: |
paul@631 | 22 | print "a or b" # a or b |
paul@631 | 23 | |
paul@631 | 24 | if not (a or b): |
paul@631 | 25 | print "not (a or b)" # |
paul@631 | 26 | |
paul@631 | 27 | if not not (a or b): |
paul@631 | 28 | print "not not (a or b)" # not not (a or b) |