Question
Fill in the `read_file_in_reverse()` function to return a list of the lines of a file in reverse order. def read_file_in_reverse(file_name): Reads a file and
Fill in the `read_file_in_reverse()` function to return a list of the lines of a file in reverse order.
def read_file_in_reverse(file_name):
""" Reads a file and returns a list of the lines in reverse order
[IMPLEMENT ME]
1. Open and read the given file into a variable
2. Read the file line-by-line and store the lines in a list in reverse order
3. Print the list
4. Return the list
Args:
file_name: the name of the file to be read
Returns:
list: list of the lines of the file in reverse order.
"""
### WRITE SOLUTION HERE
raise NotImplementedError()
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