Question: Problem 4. (Reverse) Implement the function reverse() in reverse.py that reverses the one-dimensional list a in place, ie, without creating a new list. $ python3
Problem 4. (Reverse) Implement the function reverse() in reverse.py that reverses the one-dimensional list a in place, ie, without creating a new list. $ python3 reverse.py to be or not to be that is the question 
reverse.py (/coursework File Edit View Search Tools Documents Help import stdio import sys # Reverse th def reverse(a): Reverse the one-dinensional List a in place, ie. wi thout creating a new list # Iterate over half of the list a. Exchange element at i in a with the # element at len (a) -1-1. for i in: # Test rsesente lO NOT andlprinteadhesteversedrons standard input into a List def main): a stdio. readAlStrings() reverse(a) for v in al:-11: stdio.writef( SV) stdio.writeln(al-11) if name main)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
