""" Programming with Python for Social Science Phillip Brooker 5. 1. 3. LIST EXERCISE """ #Look at this big list (which contains a lot of numbers between 0 and 999)! num_list = [387, 729, 730, 94, 727, 535, 367, 59, 446, 740, 588, 307, 225, 956, 175, 961, 332, 731, 875, 362, 53, 738, 647, 258, 888, 421, 941, 710, 955, 192, 935, 93, 335, 748, 987, 20, 937, 404, 191, 586, 847, 906, 6, 504, 821, 218, 532, 688, 358, 568, 22, 245, 573, 689, 942, 171, 15, 781, 353, 856, 17, 697, 879, 845, 877, 968, 279, 547, 935, 331, 660, 725, 394, 617, 874, 648, 863, 53, 59, 494, 178, 650, 113, 141, 215, 616, 811, 377, 745, 349, 898, 944, 286, 183, 307, 910, 910, 348, 922, 111, 409, 549, 883, 633, 899, 414, 827, 446, 132, 125, 371, 281, 496, 224, 828, 942, 350, 424, 9, 1000, 354, 932, 130, 137, 43, 362, 392, 188, 514, 247, 142, 914, 899, 204, 83, 565, 499, 422, 872, 346, 62, 317, 776, 619, 325, 789, 721, 530, 925, 135, 637, 935, 185, 491, 880, 38, 235, 720, 566, 633, 609, 372, 280, 223, 26, 956, 918, 5, 899, 775, 318, 391, 596, 783, 144, 370, 699, 86, 856, 3, 660, 547, 887, 894, 824, 118, 941, 13, 22, 855, 575, 570, 278, 631, 693, 530, 797, 468, 422, 517, 30, 264, 162, 712, 627, 345, 23, 41, 195, 986, 200, 642, 708, 203, 817, 767, 142, 892, 722, 852, 554, 112, 42, 171, 497, 211, 198, 677, 697, 375, 477, 292, 449, 572, 96, 997, 778, 677, 200, 528, 944, 84, 685, 564, 978, 826, 436, 919, 716, 866, 47, 115, 859, 613, 378, 890, 939, 533, 709, 669, 777, 506, 197, 483, 716, 790, 736, 290, 185, 766, 824, 446, 334, 990, 972, 676, 345, 553, 658, 360, 697, 58, 651, 306, 980, 238, 107, 612, 173, 350, 38, 69, 611, 628, 197, 678, 73, 950, 409, 234, 536, 575, 867, 727, 736, 157, 363, 704, 606, 732, 904, 901, 600, 718, 949, 992, 28, 242, 39, 570, 430, 673, 786, 764, 230, 821, 927, 997, 242, 103, 30, 349, 71, 199, 369, 476, 534, 465, 382, 307, 414, 94, 654, 336, 977, 151, 100, 815, 405, 164, 357, 5, 335, 183, 408, 549, 836, 184, 968, 464, 889, 820, 65, 227, 149, 902, 480, 712, 996, 718, 198, 324, 748, 180, 864, 697, 247, 887, 318, 952, 228, 593, 246, 707, 676, 192, 931, 566, 274, 614, 658, 730, 255, 996, 112, 228, 858, 998, 994, 196, 207, 426, 891, 180, 812, 743, 67, 360, 521, 876, 530, 89, 899, 718, 941, 869, 485, 252, 194, 998, 929, 687, 648, 745, 586, 534, 8, 759, 667, 867, 379, 172, 115, 576, 743, 270, 945, 144, 184, 742, 923, 536, 205, 367, 502, 987, 297, 54, 426, 156, 278, 574, 440, 391, 440, 734, 608, 839, 993, 140, 504, 405, 912, 57, 15, 503, 69, 921, 925, 426, 813, 862, 355, 318, 731, 2, 609, 848, 722, 35, 930, 646, 903, 7, 475, 889, 95, 285, 523, 823, 641, 257, 372, 614, 729, 296, 237, 202, 764, 927, 385, 982, 49, 317, 983, 483, 651, 471, 246, 340, 837, 701, 345, 413, 528, 163, 93, 57, 466, 911, 131, 580, 30, 196, 667, 508, 423, 306, 163, 971, 282, 915, 423, 156, 480, 464, 976, 748, 72, 641, 451, 486, 442, 315, 407, 70, 907, 220, 906, 398, 753, 911, 490, 39, 172, 509, 417, 450, 786, 68, 596, 422, 403, 175, 739, 306, 314, 253, 485, 733, 782, 219, 65, 666, 468, 927, 666, 323, 271, 553, 911, 844, 384, 792, 534, 288, 658, 941, 78, 404, 808, 535, 336, 26, 192, 769, 606, 383, 6, 148, 340, 52, 169, 619, 836, 495, 333, 240, 399, 881, 462, 543, 104, 623, 377, 651, 345, 33, 285, 692, 509, 169, 315, 250, 72, 648, 326, 766, 776, 513, 43, 473, 464, 581, 563, 492, 977, 944, 774, 309, 6, 784, 945, 583, 813, 993, 55, 408, 45, 852, 100, 413, 156, 9, 832, 203, 513, 976, 231, 114, 638, 825, 498, 837, 153, 203, 781, 549, 621, 759, 363, 48, 187, 512, 472, 983, 993, 71, 215, 976, 395, 294, 188, 6, 930, 473, 134, 329, 674, 293, 154, 758, 328, 587, 655, 387, 413, 354, 282, 161, 704, 45, 280, 312, 456, 754, 942, 609, 398, 661, 456, 296, 195, 24, 642, 364, 958, 462, 481, 102, 480, 443, 516, 631, 109, 533, 254, 65, 249, 18, 479, 710, 129, 84, 345, 268, 177, 530, 965, 107, 180, 934, 451, 725, 789, 341, 668, 262, 8, 183, 246, 464, 734, 349, 271, 801, 550, 749, 822, 610, 649, 525, 557, 635, 812, 969, 26, 812, 977, 314, 29, 989, 668, 651, 158] #NOW, let's do stuff with it. QUESTION: Can you tell me: #Q1: How many things are in this list? #Q2: What are the last 20 items of the list, sorted numerically? #Q3: What is the range of the first 50 items? #Q4: What is the range of the first 50 items after you've inserted a value of #5000 at index position 30? """ EXERCISE: Can you now: * Break the first 25 numbers in num_list up into batches of 5, each stored in a list of its own. * Then compile those 5 mini lists into a bigger one. * Then, can you tell me what the third element of the fourth list is? DO ALL THIS USING PYTHON COMMANDS: FIDDLING IN THE ORIGINAL LIST/SCRIPT IS CHEATING!!! """