Question
Part 4) Create a dictionary of the min, max, and sum of testlist. The keys should be min, max, and sum. Part 4b) Using a
Part 4) Create a dictionary of the min, max, and sum of testlist. The keys should be "min", "max", and "sum".
Part 4b) Using a for loop and the .keys() function, loop over the keys of your dictionary and print out a table, like:
# min : 23 <-- just an example! Not the correct numbers!
# max : 101
# sum : 1023
Try to get the columns to line up. 4c. ) 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. 4d. ) Using your sum function, add up all of the remaining numbers and print out the sum. 4e. ) 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" 4f. ) 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. 4g. ) What is the sum of the new list? Use your my_sum function
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started