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

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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