Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Write program named program71.py as follows. Follow instructions carefully to avoid point deductions.

In the main function:

  • create list named states1 that holds the two-letter abbreviations of the first 10 USA states, in alphabetical order.
  • use a loop to process the list and display the abbreviations all on the same line, separated by a single space. See sample output.
  • make a second list named states2 by slicing. This new list must hold the middle four state abbreviations from states1.
  • execute a function named list_func with states2 as its sole argument.
  • inside the list_func function:
  • delete the second element in the list
  • insert the abbreviation for Texas into the list at index 2
  • prompt the user for the abbreviation of another state of your choice, then append it to the list
  • reverse the list
  • return the list to main
  • back in main, use a loop to iterate over the returned list, printing all abbreviations on one line separated by a space.

Sample Output

Initial list of state abbreviations

AL AK AZ AR CA CO CT DE FL GA 

Enter the state abbreviation for Kentucky KY

List returned by list_func

KY CT TX CO AR

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92524869
  • Price:- $10

Priced at Now at $10, Verified Solution

Have any Question?


Related Questions in Computer Engineering

State the required answer precisely and then provide proper

State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. Provide examples and state precisely the meaning of the following features supported by ...

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What are some examples of when a data compression utility

What are some examples of when a data compression utility can be used for information stored on a computer's hard drive?

Question suppose that in game of chance you bet an initial

Question : Suppose that in game of chance, you bet an initial amount of money, and every time you play, the money is doubled with probability p and halved with probability 1 - p. (a) What value of p gives you an expected ...

Question suppose you want to perform two sums one is a sum

Question : Suppose you want to perform two sums: one is a sum of 10 scalar variables, and one is a matrix sum of a pair of two-dimensional arrays, with dimensions 10 by 10. What speed-up do you get with 10 versus 100 pro ...

A group of students made the following scores on a 10-item

A group of students made the following scores on a 10-item quiz in psychological statistics: {5, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10} What is the variance, treating these scores as a sample?

This is a software testing techniques class so i want to

This is a software testing techniques class so I want to write about test paths using node/edge or edge-pair coverage using a real or fictitous software project. Compose a short email to the decision-maker in your organi ...

What are some of the uses of bayes theorem as in what type

What are some of the uses of bayes' theorem. As in what type of problems could I come across in a Biostatistics quiz

A bar wants to move into a new area they want to find out

A bar wants to move into a new area. They want to find out the average income of people in the area to set a price point. To estimate the income of the locals with an error of at most $5,000 at a 80% confidence level, wh ...

The gravitational attraction between any two objects in the

The gravitational attraction between any two objects in the universe is given by the following formula: Force of Gravity = (G * m * n) / r 2 Where  m  and  n  are masses of the objects in kilograms,  r  is the distance b ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As