5. Reading Between the lines


#1



https://www.codecademy.com/en/courses/python-intermediate-en-OGNHh/1/1?curriculum_id=4f89dab3d788890003000096


Traceback (most recent call last):
File "python", line 1, in
IOError: [Errno 2] No such file or directory: 'text.txt'


Replace this line with your code. 
my_file = open("text.txt", "r")
print my_file.readline()
print my_file.readline()
print my_file.readline()
my_file.close()


#2

This discussion might help you.

here


#3

It didnt, i found this u wrote
In your text.txt file surround all your sentences inside the quotes like I did.

"I'm the first line of the file!"
"I'm the second line."
"Third line here, boss."

"in your text.txt file" i dont understand, i mean how do i change the info inside text.txt i know this should be a bug, hope u can help me out, been stuck due to some technicall issue is the worse thing ever


#4

i already found a solution to the bug

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

print my_file.readline()
print my_file.readline()
print my_file.readline()

my_file.close()

hope this can help someone


#5

Im referring to this text.txt file...

You can click on text.txt icon and edit things,
Add three strings there (sentences inside quotes)
if that gives ya error. (try to submit + refresh the page)
add one more string,,then again it will give ya error ..refresh it and it will let you pass!


#6

Thank you so much, im about to finisht the course now !


#7

Yes, it helped me, thank you so much haha, had no idea what I was doing wrong, thought it was a bug in the program


#8

Thanks @greentreemee, Worked for me :slight_smile:


#9

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