Question: PYTHON Create a program that reverses the elements in a list. To do this, you will have to index each element in the list, starting
PYTHON Create a program that reverses the elements in a list. To do this, you will have to index each element in the list, starting from the end, and append it to a new, empty list. Write the program so that it will work with a list of any length.
fruits = ["apple", "banana", "kiwi", "tomato", "apricot"]
reversed_fruits = []
### YOUR CODE HERE ### #
This is the output that you should get:
print(reversed_fruits)
['apricot', 'tomato', 'kiwi', 'banana', 'apple']
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
