2016-11-26 | Paul Boddie | file changeset files shortlog | Added another failure test. |
paul@141 | 1 | def f(a, b, c): |
paul@141 | 2 | return a and b and c |
paul@141 | 3 | |
paul@141 | 4 | def g(a, b, c): |
paul@141 | 5 | return a or b or c |
paul@141 | 6 | |
paul@141 | 7 | def h(a, b, c): |
paul@141 | 8 | return a and b or c |
paul@141 | 9 | |
paul@141 | 10 | def i(a, b, c): |
paul@141 | 11 | return a or b and c |
paul@141 | 12 | |
paul@141 | 13 | def j(a, b, c): |
paul@141 | 14 | return f(a, b, c) and g(a, b, c) or c |
paul@202 | 15 | |
paul@202 | 16 | print f(0, 0, 0) # 0 |
paul@202 | 17 | print f(1, 0, 1) # 0 |
paul@202 | 18 | print f(1, 1, 1) # 1 |
paul@202 | 19 | print g(0, 0, 0) # 0 |
paul@202 | 20 | print g(1, 0, 0) # 1 |
paul@202 | 21 | print g(0, 0, 1) # 1 |
paul@202 | 22 | print h(0, 0, 0) # 0 |
paul@202 | 23 | print h(0, 0, 1) # 1 |
paul@202 | 24 | print h(1, 0, 0) # 0 |
paul@202 | 25 | print i(0, 0, 0) # 0 |
paul@202 | 26 | print i(0, 0, 1) # 0 |
paul@202 | 27 | print i(1, 0, 0) # 1 |
paul@202 | 28 | print j(0, 0, 0) # 0 |
paul@202 | 29 | print j(0, 0, 1) # 1 |
paul@202 | 30 | print j(1, 0, 0) # 0 |