4. Write a python program to read the whole file, a.txt.
The output is:
Original file a.txt:
Welcome to
www.freelearningpoints.com
Expected Answer:
Welcome to
www.freelearningpoints.com
Sample Answer:
def read_file(file_name):
txt = open(file_name)
print(txt.read())
read_file('a.txt')
More Exercises:
Python String ExercisesMore Numpy Exercises:
Numpy String ExercisesMore Pandas Exercises:
Pandas Series ExercisesMore Tutorials:
Python Installation - Linux (Ubuntu)