28 Sep Instructions:?? Please create these two programs. Write a program as follows. Follow instructions carefully to avoid point deductions. All statements should be in the main functio
Please create these two programs.
Write a program as follows. Follow instructions carefully to avoid point deductions. All statements should be in the main function:
create an empty list named nums.
use a loop to add 20 random integers, all in the range from 1-100, to nums.
print the total of all list elements.
print the highest number in the list.
print the lowest number in the list.
sort the list and then reverse it.
use another loop to display the sorted numbers in descending order, all on the same line, separated by a single space.
determine if 75 is in the list. If it is, report the index of its first occurrence. If it is absent from the list, indicate that, too.
make a new list named middle_10 by slicing out the middle 10 elements of the descending list. Use a loop to display the elements in middle_10 all on one line.
make an empty list named evens and another empty list named odds.
use a loop to process nums, adding even elements and odd elements to their respective lists.
print both evens and odds. Crude dumps inside [ ] as shown next are okay.
Sample Output 1
List total: 712
Highest number: 85
Lowest number: 2
All list elements in descending order
85 83 67 67 58 53 50 49 30 28 23 21 20 20 16 15 14 8 3 2
75 not in the list
Middle 10 after descending sort: 53 50 49 30 28 23 21 20 20 16
Even #s [58, 50, 30, 28, 20, 20, 16, 14, 8, 2]
Odd #s [85, 83, 67, 67, 53, 49, 23, 21, 15, 3]
Sample Output 2
List total: 1000
Highest number: 99
Lowest number: 2
All list elements in descending order
99 98 87 85 78 75 72 71 54 48 47 35 31 29 25 20 18 16 10 2
First found 75 at index 5
Middle 10 after descending sort: 75 72 71 54 48 47 35 31 29 25
Even #s [98, 78, 72, 54, 48, 20, 18, 16, 10, 2]
Odd #s [99, 87, 85, 75, 71, 47, 35, 31, 29, 25]
Our website has a team of professional writers who can help you write any of your homework. They will write your papers from scratch. We also have a team of editors just to make sure all papers are of HIGH QUALITY & PLAGIARISM FREE. To make an Order you only need to click Ask A Question and we will direct you to our Order Page at WriteDemy. Then fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Fill in all the assignment paper details that are required in the order form with the standard information being the page count, deadline, academic level and type of paper. It is advisable to have this information at hand so that you can quickly fill in the necessary information needed in the form for the essay writer to be immediately assigned to your writing project. Make payment for the custom essay order to enable us to assign a suitable writer to your order. Payments are made through Paypal on a secured billing page. Finally, sit back and relax.
About Wridemy
We are a professional paper writing website. If you have searched a question and bumped into our website just know you are in the right place to get help in your coursework. We offer HIGH QUALITY & PLAGIARISM FREE Papers.
How It Works
To make an Order you only need to click on “Order Now” and we will direct you to our Order Page. Fill Our Order Form with all your assignment instructions. Select your deadline and pay for your paper. You will get it few hours before your set deadline.
Are there Discounts?
All new clients are eligible for 20% off in their first Order. Our payment method is safe and secure.
