Answer to Question #102284 in Python for brenda

Question #102284
Write a program that opens “text.txt” for reading and then prints out the first line of the file. Remember to
close the file when you’re done
1
Expert's answer
2020-02-04T06:45:27-0500

fi = open("text.txt")

first_line = fi.readline()

print(first_line)

fi.close()


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS