Question
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started