"Did you create a variable called my_file? "


#1

Can anyone help me figure out why this is not working? I have no idea what's going wrong with this. I keep on getting "Did you create a variable called my_file.

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

print my_file.read()

my_file.close()

#2

In lesson 3 we created a list and wrote it to the output.txt file. That list should still be present in lesson 4. Check the 'output.txt' tab to see if the list is there. If not, then type some lines of text. Be sure to hit Enter after the last line. Your code in the script.py tab should now run.

If this doesn't work, go back to lesson 1, Submit. Continue to lesson 2, Submit. Continue to lesson 3. Submit. Continue to lesson 4. Submit. It worked for me, just now.


#3

Oh, wow. That worked. Something must have reset itself while doing the lesson. Thank you.


#4

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