Question: Task 1 . Implement your function to perform a one - time reversal on the input sequence perform _ reversal ( data , a ,
Task Implement your function to perform a onetime reversal on the input sequence
performreversaldata a b function implementation
Give a list of values data, and two indices a and b a b you must produce and return a new list that reflects a reversal of all the values from index a to b inclusive. For example, a call to
performreversal
should return the list
Note: Make sure to keep the first value and last value in the input list always be same as the first value is always to be and the last value is always to be the maximum. Just need to move the order of the intermediate values.
def performreversaldata a b: Return a new sequence that reflects inverting the portion of data from indices a to b inclusive.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
