Question: Write a python method named doubleList that accepts a special argument named self and an argument named input (type list of str). This method should
Write a python method named doubleList that accepts a special argument named self and an argument named input (type list of str). This method should return a list containing twice as many item as in the original list, such as:
-the first half contains the same items, but each item's string is repeated two times (e.g., for input ['a', 'b', 'c', 'd'] , the first half of the new list should be ['aa', 'bb', 'cc', 'dd'] )
-the second half contains rearranged elements of the original list: all odd elements first, then all even elements. (e.g., for input ['a', 'b', 'c', 'd'] , half of the new list should be ['a', 'c', 'b', 'd'] .
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
