77 922
Assignments Done
Successfully Done
In August 2019

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]
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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions