Question
Write a python method named double that accepts self as a first special argument and a single argument: input (type list of string). This method
Write a python method named double that accepts self as a first special argument and a single argument: input (type list of string). This method should return a list containing twice as many item as in the original list:
the first half contains the same items, but each item's string is repeated two times (e.g., for input ['foo', 'bar'] , the first part of the new list should be ['foofoo', 'barbar'] )
the second half contains rearranged elements of the original list: all odd elements first, then all even elements. For the input ['a', 'b', 'c', 'd'] , the second half should be ['a', 'c', 'b', 'd'] .
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started