Python 3.5.2 (v3.5.2:4def2a2901a5, Jun 25 2016, 22:18:55) [MSC v.1900 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> # Feb 21, 2017 >>> randrange(1,3) Traceback (most recent call last): File "", line 1, in randrange(1,3) NameError: name 'randrange' is not defined >>> # recall importint >>> sqrt(4) Traceback (most recent call last): File "", line 1, in sqrt(4) NameError: name 'sqrt' is not defined >>> from math import * >>> sqrt(4) 2.0 >>> from random import * >>> randrange(1,3) 2 >>> randrange(1,3) 2 >>> randrange(1,3) 1 >>> randint(1,3) 1 >>> randint(1,3) 3 >>> randint(1,10) 5 >>> randint(1,10) 10 >>> randint(1,10) 1 >>> randint(1,10) 8 >>> === RESTART: C:/Users/kerry.ojakian/Documents/Kerry/ProgramsFeb21_2017.py === You're going to try to read my mind. Give me a number 1 to 5, inclusive: 4 good >>> === RESTART: C:/Users/kerry.ojakian/Documents/Kerry/ProgramsFeb21_2017.py === You're going to try to read my mind. Give me a number 1 to 5, inclusive: 7 bad >>> === RESTART: C:/Users/kerry.ojakian/Documents/Kerry/ProgramsFeb21_2017.py === You're going to try to read my mind. Give me a number 1 to 5, inclusive: 3 You guessed wrong :( I was thinking of: 1 >>> === RESTART: C:/Users/kerry.ojakian/Documents/Kerry/ProgramsFeb21_2017.py === You're going to try to read my mind. Give me a number 1 to 5, inclusive: 78 You did not give me a proper number! So I will not reveal my number to you ... >>> comp 2 >>> === RESTART: C:/Users/kerry.ojakian/Documents/Kerry/ProgramsFeb21_2017.py === You're going to try to read my mind. Give me a number 1 to 5, inclusive: 45 You did not give me a proper number! So I will not reveal my number to you ... >>> === RESTART: C:/Users/kerry.ojakian/Documents/Kerry/ProgramsFeb21_2017.py === You're going to try to read my mind. Give me a number 1 to 5, inclusive: 3.5 You guessed wrong :( I was thinking of: 3 >>> int(3.8978799) 3 >>> int(3) 3 >>> abs(-3) 3 >>> abs(3.44) 3.44 >>> user = 3.26 >>> U = int(U) Traceback (most recent call last): File "", line 1, in U = int(U) NameError: name 'U' is not defined >>> U = int(user) >>> user == U False >>> user = 2.67 >>> user_int = int(user) >>> user_int 2 >>> user == user_int False >>> user = 4 >>> user_int = int(user) >>> user_int 4 >>> user == user_int True >>> === RESTART: C:/Users/kerry.ojakian/Documents/Kerry/ProgramsFeb21_2017.py === You're going to try to read my mind. Give me a number 1 to 5, inclusive: 3.45 You did not give me a proper number! So I will not reveal my number to you ... >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== You're going to try to read my mind. Give me a whole number 1 to 5, inclusive: 234 That was wrong! Give me a whole number 1 to 5, inclusive: 4.8 That was wrong! Give me a whole number 1 to 5, inclusive: 99 That was wrong! Give me a whole number 1 to 5, inclusive: -8 That was wrong! Give me a whole number 1 to 5, inclusive: 0 That was wrong! Give me a whole number 1 to 5, inclusive: 3 You guessed wrong :( I was thinking of: 2 >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== You're going to try to read my mind. Give me a whole number 1 to 5, inclusive: 4.6 That was wrong! Give me a whole number 1 to 5, inclusive: 77 That was wrong! Give me a whole number 1 to 5, inclusive: 4 You guessed wrong :( I was thinking of: 5 >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== -1 1 3 5 Now: 7 7 12 17 22 27 32 37 42 47 52 57 62 67 72 77 82 87 92 97 102 107 112 117 122 127 132 137 142 147 152 157 162 167 172 177 182 187 192 197 202 207 212 217 222 227 232 237 242 247 252 257 262 267 272 277 282 287 292 297 302 307 312 317 322 327 332 337 342 347 352 357 362 367 372 377 382 387 392 397 402 407 412 417 422 427 432 437 442 447 452 457 462 467 472 477 482 487 492 497 502 507 512 517 522 527 532 537 542 547 552 557 562 567 572 577 582 587 592 597 602 607 612 617 622 627 632 637 642 647 652 657 662 667 672 677 682 687 692 697 702 707 712 717 722 727 732 737 742 747 752 757 762 767 772 777 782 787 792 797 802 807 812 817 822 827 832 837 842 847 852 857 862 867 872 877 882 887 892 897 902 907 912 917 922 927 932 937 942 947 952 957 962 967 972 977 982 987 992 997 1002 1007 1012 1017 1022 1027 1032 1037 1042 1047 1052 1057 1062 1067 1072 1077 1082 1087 1092 1097 1102 1107 1112 1117 1122 1127 1132 1137 1142 1147 1152 1157 1162 1167 1172 1177 1182 1187 1192 1197 1202 1207 1212 1217 1222 1227 1232 1237 1242 1247 1252 1257 1262 1267 1272 1277 1282 1287 1292 1297 1302 1307 1312 1317 1322 1327 1332 1337 1342 1347 1352 1357 1362 1367 1372 1377 1382 1387 1392 1397 1402 1407 1412 1417 1422 1427 1432 1437 1442 1447 1452 1457 1462 1467 1472 1477 1482 1487 1492 1497 1502 1507 1512 1517 1522 1527 1532 1537 1542 1547 1552 1557 1562 1567 1572 1577 1582 1587 1592 1597 1602 1607 1612 1617 1622 1627 1632 1637 1642 1647 1652 1657 1662 1667 1672 1677 1682 1687 1692 1697 1702 1707 1712 1717 1722 1727 1732 1737 1742 1747 1752 1757 1762 1767 1772 1777 1782 1787 1792 1797 1802 1807 1812 1817 1822 1827 1832 1837 1842 1847 1852 1857 1862 1867 1872 1877 1882 1887 1892 1897 1902 1907 1912 1917 1922 1927 1932 1937 1942 1947 1952 1957 1962 1967 1972 1977 1982 1987 1992 1997 2002 2007 2012 2017 2022 2027 2032 2037 2042 2047 2052 2057 2062 2067 2072 2077 2082 2087 2092 2097 2102 2107 2112 2117 2122 2127 2132 2137 2142 2147 2152 2157 2162 2167 2172 2177 2182 2187 2192 2197 2202 2207 2212 2217 2222 2227 2232 2237 2242 2247 2252 2257 2262 2267 2272 2277 2282 2287 2292 2297 2302 2307 2312 2317 2322 2327 2332 2337 2342 2347 2352 2357 2362 2367 2372 2377 2382 2387 2392 2397 2402 2407 2412 2417 2422 2427 2432 2437 2442 2447 2452 2457 2462 2467 2472 2477 2482 2487 2492 2497 2502 2507 2512 2517 2522 2527 2532 2537 2542 2547 2552 2557 2562 2567 2572 2577 2582 2587 2592 2597 2602 2607 2612 2617 2622 2627 2632 2637 2642 2647 2652 2657 2662 2667 2672 2677 2682 2687 2692 2697 2702 2707 2712 2717 2722 2727 2732 2737 2742 2747 2752 2757 2762 2767 2772 2777 2782 2787 2792 2797 2802 2807 2812 2817 2822 2827 2832 2837 2842 2847 2852 2857 2862 2867 2872 2877 2882 2887 2892 2897 2902 2907 2912 2917 2922 2927 2932 2937 2942 2947 2952 2957 2962 2967 2972 2977 2982 2987 2992 2997 3002 3007 3012 3017 3022 3027 3032 3037 3042 3047 3052 3057 3062 3067 3072 3077 3082 3087 3092 3097 3102 3107 3112 3117 3122 3127 3132 Traceback (most recent call last): File "C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py", line 10, in print(k) # line 9 File "C:\Python35\lib\idlelib\PyShell.py", line 1344, in write return self.shell.write(s, self.tags) KeyboardInterrupt >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== 0 1 2 3 4 >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== 0 1 2 3 4 done >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== 0 done >>> k 0 >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== Give me a number (if you want to stop, enter 0): 3 Give me a number (if you want to stop, enter 0): 5 Give me a number (if you want to stop, enter 0): 5 Give me a number (if you want to stop, enter 0): 3 Give me a number (if you want to stop, enter 0): 0 Average is: 4.0 >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== You're going to try to read my mind. Give me a whole number 1 to 5, inclusive: -1 Give me a whole number 1 to 5, inclusive: 0 Give me a whole number 1 to 5, inclusive: 3.56 Give me a whole number 1 to 5, inclusive: 4 You guessed wrong :( I was thinking of: 2 >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== You're going to try to read my mind. Give me a whole number 1 to 5, inclusive: 34 Give me a whole number 1 to 5, inclusive: 1 You guessed wrong :( I was thinking of: 5 >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== You're going to try to read my mind. Give me a whole number 1 to 5, inclusive: 45 Give me a whole number 1 to 5, inclusive: 2.4 Give me a whole number 1 to 5, inclusive: hello Traceback (most recent call last): File "C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py", line 18, in user = eval(input("Give me a whole number 1 to 5, inclusive: ")) File "", line 1, in NameError: name 'hello' is not defined >>> eval('34') 34 >>> eval('hello') Traceback (most recent call last): File "", line 1, in eval('hello') File "", line 1, in NameError: name 'hello' is not defined >>> hello = 9 >>> hello = '98' >>> eval(hello) 98 >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== Give me number:35 45 >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== Give me number:76t8f68 Something is wrong! >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== Something is wrong! >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== You're going to try to read my mind. Give me a whole number 1 to 5, inclusive: 45 Give me a whole number 1 to 5, inclusive: 2.3 Give me a whole number 1 to 5, inclusive: hello You gave me a very bad input! Give me a whole number 1 to 5, inclusive: hhksdf You gave me a very bad input! Give me a whole number 1 to 5, inclusive: 4.5 Give me a whole number 1 to 5, inclusive: 5 You guessed wrong :( I was thinking of: 2 >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== You're going to try to read my mind. Give me a whole number 1 to 5, inclusive: hello You gave me a very bad input! Traceback (most recent call last): File "C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py", line 20, in if 1<= user <=5 and user == user_int: NameError: name 'user' is not defined >>> ======== RESTART: C:/Users/kerry.ojakian/Documents/Kerry/tempProg.py ======== You're going to try to read my mind. Give me a whole number 1 to 5, inclusive: hello You gave me a very bad input! Give me a whole number 1 to 5, inclusive: 6 Give me a whole number 1 to 5, inclusive: 3.2 Give me a whole number 1 to 5, inclusive: 4 You guessed wrong :( I was thinking of: 3 >>> S = "tuRing" >>> S.capitalize() 'Turing' >>>