Question 45
Given a list L of strings, complete function double_reverse() with valid Python expressions/statements such that it returns a list containing the reverse of all strings in L, where they are also in reverse order from L.
Here is a sample run:
Note that your code needs to be syntactically correct to gain marks. You cannot use any semi-colon(;) and we will deduct marks if your answer is too long.
Model Solution
Hint 1
You will need list comprehension for this question. What you can try to do is work out the solution without it first using a regular loop structure before converting it into its list comprehension equivalent.
Hint 2 (read Hint 1 first!)
Compress the highlighted lines 2-5 into one line.
Use [::-1] to help with reversing a string value.