1 def no_temp(a, b): 2 return not (a and b) 3 4 a = 1 5 b = 2 6 c = a and b 7 print c # 2 8 9 d = a or b 10 print d # 1 11 12 e = not a 13 print e # False 14 15 f = 0 16 17 g = no_temp(a, b) 18 print g # False 19 20 if a and b: 21 print "a and b" # a and b 22 else: 23 print "! (a and b)" 24 25 if a and f: 26 print "a and f" 27 else: 28 print "! (a and f)" # ! (a and f) 29 30 if not (a and b): 31 print "not (a and b)" 32 else: 33 print "! (not (a and b))" # ! (not (a and b)) 34 35 if not not (a and b): 36 print "not not (a and b)" # not not (a and b) 37 else: 38 print "! (not not (a and b))" 39 40 if a or b: 41 print "a or b" # a or b 42 else: 43 print "! (a or b)" 44 45 if not (a or b): 46 print "not (a or b)" 47 else: 48 print "! (not (a or b))" # ! (not (a or b)) 49 50 if not not (a or b): 51 print "not not (a or b)" # not not (a or b) 52 else: 53 print "! (not not (a or b))" 54 55 if a and b or f: 56 print "a and b or f" # a and b or f 57 else: 58 print "! (a and b or f)"