On running this code
def read_text(): quotes = open("C:\Users\rajawatk\Desktop\movie_quotes.txt") contents_of_file = quotes.read() print(contents_of_file) quotes.close() read_text() Following was the error message
IOError is displayed
if following code is run by specifying the read permissions
well if we add an r which stands for read permission like
quotes = open(r"C:\Users\rajawatk\Desktop\movie_quotes.txt") Voila, The code work i am able to read the movie_quotes.txt file and here is the output
-- Houston, we have a problem. (Apollo 13)
-- Mama always said, life is like a box of chocolates. You never know what you are going to get. (Forrest Gump)
-- You cant handle the truth. (A Few Good Men)
-- I believe everything and I believe nothing. (A Shot in the Dark)