Error in the open() function


#1



showing the error that did you create a variable called my_file


Replace this line with your code. 

my_file = open("output.txt","r+")


#2

Hmm that's strange :hushed: : Do you have any code apart from this?


#3

no this is the only code some code has to be write in output.txt or not


#4

Did you try after refreshing your browser?


#5

Please provide me with a link to the exercise you are on. :slight_smile:


#6

I have the problem on the "Reading Between the Lines" exercise. I have refreshed the code and even restarted the browser (chrome) and did not work.

The error is in the first line:

my_file = open("text.txt", "r")

Update: Doing the steps of the following post the error was fixed https://discuss.codecademy.com/t/reading-between-the-lines/44213 but is a workaround


#7

open the txt file...manually delete its contents..run the program again.voila!


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.