>>> bool(0) False >>> bool(314) True >>> bool("") False >>> bool("weqrijterwwer") True >>> bool(None) False >>> bool([]) False >>> bool([1,2,3]) True >>> >>> x = 5 >>> x = x + 2 >>> x 7 >>> x += 2 >>> x 9 >>> x *= 2 >>> x 18 >>> #compound assignment operator >>> x -= 1 >>> x 17 >>> (base) MAC:Thu Mar 04:10:37:0304B> !vi vi bozo.py (base) MAC:Thu Mar 04:10:38:0304B> !p python Python 3.8.5 (default, Sep 4 2020, 02:22:02) [Clang 10.0.0 ] :: Anaconda, Inc. on darwin Type "help", "copyright", "credits" or "license" for more information. >>> (base) MAC:Thu Mar 04:10:38:0304B> python bozo.py [-9, -2, 2, 3, 5, 8, 9] (base) MAC:Thu Mar 04:10:38:0304B> !vi vi bozo.py (base) MAC:Thu Mar 04:10:38:0304B> !p python bozo.py [-9, -2, 2, 3, 4, 5, 6, 8, 9] (base) MAC:Thu Mar 04:10:38:0304B> !vi vi bozo.py (base) MAC:Thu Mar 04:10:49:0304B> ls bozo.py (base) MAC:Thu Mar 04:10:49:0304B> vi guessing_game.py (base) MAC:Thu Mar 04:11:08:0304B> python guessing_game.py (base) MAC:Thu Mar 04:11:08:0304B> !vi vi guessing_game.py (base) MAC:Thu Mar 04:11:09:0304B> !p python guessing_game.py Enter a guess: 50 Your guess 50 is too small. Enter a guess: 75 Your guess 75 is too big. Enter a guess: 63 Your guess 63 is correct! (base) MAC:Thu Mar 04:11:09:0304B> !vi vi guessing_game.py (base) MAC:Thu Mar 04:11:10:0304B> ls bozo.py guessing_game.py (base) MAC:Thu Mar 04:11:10:0304B> !vi vi guessing_game.py (base) MAC:Thu Mar 04:11:16:0304B> ls bozo.py guessing_game.py (base) MAC:Thu Mar 04:11:16:0304B> vi nag.py (base) MAC:Thu Mar 04:11:21:0304B> python nag.py File "nag.py", line 1 def is_legit_integer(x) ^ SyntaxError: invalid syntax (base) MAC:Thu Mar 04:11:21:0304B> !vi vi nag.py (base) MAC:Thu Mar 04:11:21:0304B> !p python nag.py Traceback (most recent call last): File "nag.py", line 11, in <module> while not is_legit_integer(x): NameError: name 'x' is not defined (base) MAC:Thu Mar 04:11:21:0304B> !vi vi nag.py (base) MAC:Thu Mar 04:11:21:0304B> !p python nag.py Traceback (most recent call last): File "nag.py", line 11, in <module> while not is_legit_integer(number): File "nag.py", line 6, in is_legit_integer if not k.isdigit(): AttributeError: 'int' object has no attribute 'isdigit' (base) MAC:Thu Mar 04:11:21:0304B> !vi vi nag.py (base) MAC:Thu Mar 04:11:21:0304B> !p python nag.py Enter an integer56 45 ^CTraceback (most recent call last): File "nag.py", line 11, in <module> while not is_legit_integer(number): File "nag.py", line 6, in is_legit_integer if not x[k].isdigit(): KeyboardInterrupt (base) MAC:Thu Mar 04:11:22:0304B> !vi vi nag.py (base) MAC:Thu Mar 04:11:22:0304B> !p python nag.py Enter an integer56 56 is an integer (base) MAC:Thu Mar 04:11:22:0304B> python nag.py Enter an integercows Enter an integerhorses Enter an integercrowley Enter an integerdunderhead Enter an integer3432 3432 is an integer (base) MAC:Thu Mar 04:11:23:0304B> python nag.py Enter an integer-5 -5 is an integer (base) MAC:Thu Mar 04:11:23:0304B> python nag.py Enter an integer+14 +14 is an integer (base) MAC:Thu Mar 04:11:23:0304B> !vi vi nag.py (base) MAC:Thu Mar 04:11:26:0304B> vi doubles.py (base) MAC:Thu Mar 04:11:27:0304B> python doubles.py (2, 1) (1, 6) (1, 4) (1, 2) (3, 4) (1, 5) (2, 6) (6, 4) (5, 5) (5, 2) (base) MAC:Thu Mar 04:11:27:0304B> !vi vi doubles.py (base) MAC:Thu Mar 04:11:31:0304B> vi moore.py (base) MAC:Thu Mar 04:11:31:0304B> python moore.py You rolled doubles of 5 after 2 rolls. (base) MAC:Thu Mar 04:11:31:0304B> !vi vi moore.py (base) MAC:Thu Mar 04:11:32:0304B> !p python moore.py (2, 2) You rolled doubles of 2 after 1 rolls. (base) MAC:Thu Mar 04:11:32:0304B> python moore.py (1, 6) (2, 4) (1, 2) (4, 4) You rolled doubles of 4 after 4 rolls. (base) MAC:Thu Mar 04:11:32:0304B> python moore.py (2, 4) (3, 4) (2, 1) (2, 4) (3, 6) (2, 3) (2, 5) (6, 3) (2, 4) (1, 3) (5, 6) (5, 3) (5, 3) (4, 2) (6, 3) (1, 3) (1, 5) (4, 1) (3, 6) (6, 5) (5, 4) (3, 2) (3, 6) (6, 5) (4, 3) (5, 5) You rolled doubles of 5 after 26 rolls. (base) MAC:Thu Mar 04:11:32:0304B> python moore.py (2, 2) You rolled doubles of 2 after 1 rolls. (base) MAC:Thu Mar 04:11:32:0304B> python moore.py (5, 2) (6, 5) (3, 1) (5, 1) (1, 3) (2, 1) (3, 4) (3, 6) (3, 6) (6, 3) (5, 5) You rolled doubles of 5 after 11 rolls. (base) MAC:Thu Mar 04:11:32:0304B> python moore.py (5, 3) (4, 2) (1, 2) (5, 2) (4, 2) (5, 2) (1, 5) (1, 4) (6, 1) (4, 1) (6, 5) (1, 3) (3, 1) (1, 3) (3, 3) You rolled doubles of 3 after 15 rolls. (base) MAC:Thu Mar 04:11:32:0304B> ls bozo.py guessing_game.py nag.py doubles.py moore.py (base) MAC:Thu Mar 04:12:17:0304B>