62 541
Assignments Done
98,7%
Successfully Done
In June 2018

Answer to Question #3379 in Python for mukunda

Question #3379
Write a python program to print first 2 lines from “rgukt.txt” file
Expert's answer
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 first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions