How to read two 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())


'''
run:
 
C++

VB.NET

'''

 



answered Nov 26, 2018 by avibootz

Related questions

2 answers 243 views
1 answer 180 views
1 answer 183 views
2 answers 255 views
1 answer 262 views
...