1. Write a single program named lister.py as follows. Use the methods described below to avoid point deductions.

In the main function:

  • create an empty list named nums.
  • use a for loop to add ten integers, each in the range 20 to 80 inclusive, to nums. Duplicates are okay.
  • use a while loop to display the ten integers all on one line separated by a single space.
  • display the largest integer in the list.
  • display the smallest integer in the list.
  • make and name a slice from nums that is missing the first and last elements.
  • call a void function named process that takes the slice made from nums as an argument.

In the process function:

  • sort the slice elements in highest to lowest order.
  • display the elements in the slice all on one line separated by a single space. The elements should NOT be displayed inside [ ] separated by commas.

Example Output

79 30 36 33 41 75 43 60 39 53
The highest number is 79
The lowest number is 30
The middle 8 elements sorted high to low:
75 60 43 41 39 36 33 30
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.