In this assignment we will code using a list. We will generate a list of 20 numbers using the random number generator. Next we need to write code for a new function called reverse. (Please note, Python has a built in function to perform this task - we are not using that - we are coding a version of it ourselves).

This new function, reverse, creates another list in which the sequence of all the items is reversed.

Here is the process we will use:

  • First, using just a paper and pencil, we will figure out how to do this. There is more than one way to do this - use the one you are most comfortable with.
  • Next, we will capture this algorithm, from step 1, in pseudo code. Walk thru this to make sure it will work. The pseudo code will be entered as comments at the start of your Python code.
  • Lastly, we will write the code, and execute it (10 points). Make sure the code is well annotated with comments
  • The output should be the two lists and the big-O complexity of your code

Note Again: Python lists have a built in method called reverse - we will not use this method - instead we are defining our own method.

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.