Question: From now on we will use this list: testlist = [1,2,3,10, 12, 15, 1,2,3,4,100, 101, 102, 20, 21, 21, 23, 24, 25, 26, 103, 104,
From now on we will use this list: testlist = [1,2,3,10, 12, 15, 1,2,3,4,100, 101, 102, 20, 21, 21, 23, 24, 25, 26, 103, 104, 104, 104]
Now, use "del" to remove the 10 largest numbers of the testlist. Use a for loop, and call find_max_index inside of the loop. 1a.) Using your sum function, add up all of the remaining numbers and print out the sum. 1b.) If the sum is larger than 100, print "The sum was larger than 100" If the sum isn't larger than 100, print "The sum wasn't larger than 100" 1c.) Now, go back to Part 4, copy that code, and make a new list with the 10 largest numbers. Use a for loop and "append" to make the list. You should use a fresh copy of testlist.
Part 4) Create a dictionary of the min, max, and sum of testlist. The keys should be "min", "max", and "sum". 1d.) What is the sum of the new list? Use your my_sum function
In Python language
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
