Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

program7_1.py python programThis assignment requires the main function and a custom value-returning function. The value-returning function takes a list of random integers as its only

program7_1.py python programThis assignment requires the main function and a custom value-returning function. The value-returning function takes a list of random integers as its only argument and returns a smaller list of only the odd numbers in that list. The main function needs these steps in this sequence: create an empty list that will the hold random integers. use a loop to add 30 random integers to the list. All integers should be between 20 and 70, inclusive. Duplicates are okay. use another loop to display all 30 integers on one line separated by spaces. report the highest and lowest integers in the list. 50 might be in the list. Report the index of the first instance of 50 or report that it didn't make the list. using slice syntax: print the integers from index 4-10, inclusive, in the list. print the final 6 integers in the list. write a custom value-returning function with the complete list as its only argument. In this function: sort the list of odd integers in high to low order use a loop to display all odd integers on one line separated by spaces. return the sum of the list of odd integers. in the main function, call the custom function and report the number of elements in the list that was returned. Be cert

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Professional SQL Server 2012 Internals And Troubleshooting

Authors: Christian Bolton, Justin Langford

1st Edition

1118177657, 9781118177655

More Books

Students also viewed these Databases questions

Question

Y = 1/2x 3

Answered: 1 week ago

Question

=+1 What makes a firm a transnational enterprise?

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago