Question: Program: Python Create a program that opens the text file and reads the prints out each line of a text file. However, if text files

Program: Python

Create a program that opens the text file and reads the prints out each line of a text file. However, if text files contain non-English languages (such as ) The program should handle the exception and print out the error message.

For example

example1.txt

Hello World?

My name is E.T.

Fun-Fact!

example2.txt

Hello World!

My nam is E.T.

readFile('example1.txt') will output

Hello World?

My name is E.T.

Fun-Fact!

readFile('example2.txt') will output

Sorry, I can't understand.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!