Answer to Question #3379 in Python for mukunda

Question #3379
Write a python program to print first 2 lines from “rgukt.txt” file
1
Expert's answer
2011-08-02T14:07:09-0400
ctr = 2
for s in open ("rgukt.txt"):
if s[-1] == '\n': s = s[:-1]
print(s)
ctr -= 1
if ctr == 0: break

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