How to read three lines of a text file in Python

1 Answer

0 votes
f = open("d:\data.txt", "rt")  # OR f = open("d:\data.txt")

print(f.readline())
print(f.readline())
print(f.readline())


'''
run:
 
C++

VB.NET

C#

'''

 



answered Nov 26, 2018 by avibootz

Related questions

2 answers 387 views
1 answer 303 views
1 answer 277 views
2 answers 405 views
1 answer 371 views
1 answer 211 views
...