Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using Python 3+ Given the following list: myList = [1, 10, 20, 21, 5, 7, 9, 13, 10, 20, 55] Create one program. As you

Using Python 3+ Given the following list:

myList = [1, 10, 20, 21, 5, 7, 9, 13, 10, 20, 55]

Create one program. As you change values in the list do not keep going back to the original list, but keep doing the problems based on the new list you just created. I expect the myList to equal [1, 5, 7, 8, 9, 12, 13, 15, 15, 16, 20, 20, 21] when you are done. Make sure that you are printing out the list values for each operation so I can see the result of what you did. Put in comments, so I can see each of the following steps you are doing.

Find the length of the list.

Find the sum of all the numbers in the list. print that sum.

Find the largest number and the index of the largest number. Print the largest number and the index

Test in a loop to see if each value in the list is equal to 21. Use an "if" statement. Tell me the index where you find the 21.

Change all 10's in the list to 15, then print the list.

Create a new list [20, 8] and then concatenate the two lists together (old first then new second), and finally print the new concatenated list, but call it the same name as the original list (myList).Print the list.

With the append( ) method add a 12 to the end of the list, then print the list.

With the insert( ) method, add a 16 to the front of the list, then print the list.

Sort the list, then print the list.

With the pop( ) function, delete the last item in the list, then print the item that was deleted from the list, as well as the list.

Count how many 20's are in the list. Print the count.

With remove(), delete the first number 20 from the list, then print the list.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

Is SHRD compatible with individual career aspirations

Answered: 1 week ago