Create an empty list named nums

Assignment Help Basic Computer Science
Reference no: EM131296369

- 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

Reference no: EM131296369

Questions Cloud

Find a qualitative quantitative and mixed methodology study : Find a qualitative, a quantitative and a mixed methodology study on any of the 3 mentioned topics above. Share the title of each and share the abstract of each in your own words.
Write without summation notation a model : Write without summation notation a model to determine which dragline will he shifted to which new mine site in order to achieve the maximum total profit.
How is intrinsic value estimated in business valuation : What is the intrinsic value? Why is it so important? How is it estimated in business valuation? What is WACC? Why is it so important in business valuation?
Create an empty list named nums : Add more comments as needed in each program to explain what your code is doing and choose descriptive variable names in all programs.
Before the jobs act-what are the gun-jumping rules : Before the JOBS Act, what are the “gun-jumping” rules? What is the process known as testing-the-waters post-JOBS Act?
Identify the dsm diagnostic category for the disorder : Identify the DSM diagnostic category for the disorder and distinguish between diagnostic and commonly used terminology.Identify the treatment approach for your case based upon the theory you have chosen to explain the disorder.
Compute price and usage variances for materials : At the beginning of the year, Shults Company had the following standard cost sheet for one of its plastic products: Direct materials (6 lbs. @ $5) $30.00 Direct labor (2 hrs. @ $12) 24.00 Standard prime cost per unit $54.00 The actual results for the..
Describe the problem in the scenario that you have chosen : Define the problem in the scenario that you have chosen. Analyze the problem in the scenario. Generate options for solving the problem in the scenario. Evaluate the options for solving the problem.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Print the file path and the number of lines in the file

Run my script on a weekday, redirecting your output to the file my_save and append a copy of my script.

  Int countrypopulation

The following variable has already been defined: int countryPopulation = 1344130000; Using that variable (do not type the large number) along with text, finish the print statement to print the following: China's population was 1344130000 in 2011.

  Write code application using a sub procedure

I need to code an application using a sub procedure to boh calculate and display a 10% bonus, use a sub procedure named ClearLabel to clear the contents of the bonusLabel whne the TextChanged even occurs for either text box

  Flow properties and definitions

Extend the flow properties and definitions to the multiple-source, multiple-sink problem. Show that any flow in a multiple-source, multiple-sink flow network corresponds to a flow of identical value in the single-source, single-sink network obtain..

  How can the virtual organization site be improved

Recommendations for improving the Virtual Organization site based on the evaluations (consider the similar sites and the current Virtual Organization site - how can the Virtual Organization site be improved?).

  Design and implement the following classes

A subclass of Employee called Non Hourly Employee that describes an employee who gets paid a fixed salary every month. Include a public method called get Pay that returns the pay of the employee for that month. Include any other relevant methods.

  Analyze these data to test the null hypothesis

Analyze these data to test the null hypothesis that delay after exposure does not affect leaflet angle

  Is cost a critical factor in your market segment

Consider the specific application environment in your organization, how would different QA alternatives compare? In addition, is cost a critical factor in your market segment? How would it affect the choice of different QA alternatives for your pr..

  Main industries-main exports and main imports

Economy: GDP per capita (compared to the US), Main industries, main exports, and main imports (what), main trading partners (with whom, top 5)

  Show the state of the queue and the event list at each step

Show the state of the queue and the event list at each step.

  Determine physical address that code byte fetched

Suppose the same code segment base what physical address will code byte be fetched from if instruction pointer contains 539CH?

  Data for making intelligent business decisions

Businesses today are extremely reliant on large amounts of data for making intelligent business decisions. Likewise, the data warehouses are often structured in a manner that optimizes processing large amounts of data.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd