Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

- Add more comments as needed in each program to explain what your code is doing.
- Choose descriptive variable names in all programs.
- Before submitting this assignment, refer to the grading rubric to maximize your earned grade points.

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

In the main function:
- create an empty list named nums.
- use a loop to add 10 random integers, all in the range from 1-25, to the list.
- use another loop to display the numbers all on the same line, separated by a single space.
- sort the list.
- use another loop to display the sorted numbers all on the same line, separated by a single space.
- make a new list named start by slicing out the first 4 elements of the sorted nums list.
- print the start list.
- make a new list named finish by slicing out the final 5 elements of the sorted nums list.
- print the finish list.
- execute the odd_even function (defined next) with sorted nums as its sole argument.

Inside the odd_even function:
- process the list and output the number of even and odd elements.
- display the 6th element in the list.

Sample Output
10 11 10 18 23 3 11 25 23 15
3 10 10 11 11 15 18 23 23 25
[3, 10, 10, 11]
[15, 18, 23, 23, 25]
List had 3 evens and 7 odds

The 6th element in sorted nums is 15

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92051018
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Take screenshots of functions running in clisplet x1 x2 xn

Take screenshots of functions running in cLISP, Let x1, x2, ...xN be a set of input features. A linear function that represent those features, will have a following form: Fw(x1, x2, .. xn)= w0 + w1 * x1 + w2 * x2 +... + ...

Question suppose that a simple fpga programmable switch

Question : Suppose that a simple FPGA programmable switch that has four destination points (N, S, E and W) and consists of 6 pass transistors with 6-SRAM cells to program each gate (T1, T2, T3, T4, T5, T6) is used. If th ...

Do you need computers or information and communication

Do you need computers or information and communication technologies to store, organize, and manage data in organizations? Explain how the present day organizations in a developed country like the USA store and manage the ...

Question this assignment consists of two 2 sections a

Question: This assignment consists of two (2) sections: a business requirements document and a project plan. You must submit both sections as separate files for the completion of this assignment. Label each file name acc ...

Question suppose the distance between two ends of an

Question : Suppose the distance between two ends of an Ethernet LAN with a transmission rate of R bps is d meters. Can you derive a formula to find the minimum frame size, L, needed for an Ethernet packet? Using this for ...

Question imagine that you are hired as a cio of a quickly

Question: Imagine that you are hired as a CIO of a quickly growing retail chain with an online presence. You have growing transactional databases but want to build a business intelligence infrastructure. You also have va ...

In this section you will write a program to show a rotating

In this section, you will write a program to show a rotating banner on the LCD screen. Every 300 milliseconds, the text "Microcontrollers are lots of fun!" should move one position to the left. This banner should repeat ...

There are two firms that produce large commercial airplanes

There are two firms that produce large commercial airplanes, namely, Boeing and Airbus. Boeing and Airbus have different flight control systems, with many pilots preferring one system over the other. The Airbus A380 has ...

Suppose a graph is represented by a list of lists a of

Suppose a graph is represented by a list of lists A of zeroes and ones. If there is an edge from node i to j, then A[i][j] = 1, otherwise A[i][j] = 0. Write a Python function to find a path between any two nodes. Write c ...

What are the characteristics of perfect competition and

What are the characteristics of perfect competition, and does is exist in the real world?

  • 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