Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> True True >>> False False >>> x = 7 >>> x < 0 False >>> x >3 True >>> x != 2 True >>> y ='abc' >>> y != 2 True >>> y < 3 Traceback (most recent call last): File "", line 1, in y < 3 TypeError: '<' not supported between instances of 'str' and 'int' >>> y == 4 False >>> y != 2 and x <0 False >>> not (x != 2) False >>> p = x < 4 >>> p False >>> q = y != 7 >>> s = x < 0 >>> q True >>> s False >>> p and not q or s False >>> x 7 >>> p = x <10 >>> p True >>> p and not q or s False >>> a = 5 <10 >>> b = 6 !=0 >>> a True >>> b True >>> not a and b False >>> not(a and b) False >>> a = 5 > 10 >>> not a and b True >>> not (a and b) True >>> b = 6 == 0 >>> b False >>> not a and b False >>> not(a and b) True >>> type(a) >>> a False >>> b False >>> p True >>> p and a False >>> p and 1 1 >>> 1 and p True >>> a and 1 False >>> 1 and a False >>> bool(1) True >>> bool(7.0) True >>> bool(0) False >>> bool (-6) True >>> bool(0.0) False >>> bool('xyz') True >>> bool("") False >>> bool([]) False >>> bool([0]) True >>> [] and a [] >>> a and [] False >>> a False >>> not a and [] [] >>> a and [] False >>> a False >>> a and [0] False >>> not a True >>> not a and [0] [0] >>> [0, 2] and [0] [0] >>> [0,2] or [0] [0, 2] >>> ======================= RESTART: D:/CSI31F18/loops.py ======================= Continue? Yes or noy one more time Continue? Yes or noy one more time Continue? Yes or noy one more time Continue? Yes or noYes one more time Continue? Yes or non one more time >>> ======================= RESTART: D:/CSI31F18/loops.py ======================= one more time Continue? Yes or noY one more time Continue? Yes or noy one more time Continue? Yes or non >>> ======================= RESTART: D:/CSI31F18/loops.py ======================= one more time Continue? Yes or noy one more time Continue? Yes or noY one more time Continue? Yes or noY one more time Continue? Yes or nono one more time Continue? Yes or nono one more time Continue? Yes or nono one more time Continue? Yes or nono one more time Continue? Yes or nono one more time Continue? Yes or no Traceback (most recent call last): File "D:/CSI31F18/loops.py", line 6, in response = input("Continue? Yes or no") KeyboardInterrupt >>> =========================== RESTART: D:/flavor.py =========================== What flavor? {vanilla]cherry >>> flavor 'cherry' >>> =========================== RESTART: D:/flavor.py =========================== What flavor? {vanilla] Traceback (most recent call last): File "D:/flavor.py", line 5, in flavor = vanilla NameError: name 'vanilla' is not defined >>> =========================== RESTART: D:/flavor.py =========================== What flavor? {vanilla] >>> flavor 'vanilla' >>> =========================== RESTART: D:/flavor.py =========================== What flavor? {vanilla]chocolate >>> flavor 'chocolate' >>> =========================== RESTART: D:/flavor.py =========================== What flavor? {vanilla] >>> flavor 'vanilla' >>> =========================== RESTART: D:/flavor.py =========================== What flavor? {vanilla] >>> flavor 'vanilla' >>> =========================== RESTART: D:/flavor.py =========================== What flavor? {vanilla]cherry >>> flavor 'cherry' >>> =========================== RESTART: D:/flavor.py =========================== What flavor? {vanilla]chocolate >>> flavor 'chocolate' >>> =========================== RESTART: D:/flavor.py =========================== What flavor? {vanilla] >>> flavor 'vanilla' >>>