Question: python 1. Write list functions that carry out the following tasks for a list of integers. Your functions should not return a new list, instead

python
python 1. Write list functions that carry out the following tasks for

1. Write list functions that carry out the following tasks for a list of integers. Your functions should not return a new list, instead it should act on the list given to it. (a) Shift all elements by one to the right and move the last element into the first position. For example, (1,4,9,16,25] would be transformed into [25,1,4,9,16]. Name the function shift(values). (b) Replace each element except the first and last by the larger of its two neighbours. For example, (1,4,9,16,25] would be transformed into (1,9,16,25,25). Name the function larger (values). () Move all even elements to the front, otherwise preserving the order of the elements. For example, (1,4,9,16,25) would be transformed into [4,16,1,9,25). Name the function evensFirst (values)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!