This is the title:
Please write a function named everything_reversed, which takes a list of strings as its argument. The function returns a new list with all of the items on the original list reversed. Also the order of items should be reversed on the new list.
An example of how the function should work:
my_list = ["Hi", "there", "example", "one more"]
new_list = everything_reversed(my_list)
print(new_list)
Sample output
['erom eno', 'elpmaxe', 'ereht', 'iH']
This is my output:
['erom eno', 'elpmaxe', 'ereht', 'iH']
This is the failed test that has a contradiction with the exercise title:
- ['ereh', 'si', 'a', 'elttil', 'regnol', 'tsil', 'htiw', 'erom', 'sdrow']
- ['here', 'is', 'a', 'little', 'longer', 'list', 'with', 'more', 'words'] : Function should not change the original list. The list should be ['here', 'is', 'a', 'little', 'longer', 'list', 'with', 'more', 'words'] but it is ['ereh', 'si', 'a', 'elttil', 'regnol', 'tsil', 'htiw', 'erom', 'sdrow'].
I don't know if I am wrong in some way but I am not able to see it, i would love to clarify this.
Thanks in advance.
This is the title:
Please write a function named everything_reversed, which takes a list of strings as its argument. The function returns a new list with all of the items on the original list reversed. Also the order of items should be reversed on the new list.
An example of how the function should work:
my_list = ["Hi", "there", "example", "one more"]
new_list = everything_reversed(my_list)
print(new_list)
Sample output
['erom eno', 'elpmaxe', 'ereht', 'iH']
This is my output:
['erom eno', 'elpmaxe', 'ereht', 'iH']
This is the failed test that has a contradiction with the exercise title:
I don't know if I am wrong in some way but I am not able to see it, i would love to clarify this.
Thanks in advance.