Hi I am trying to read and print lines from a text.
I can print ALL the lines by typing:
myfile = open("c:/test/buffet.txt","r")
for line in myfile:
... print line
Q1. How can I print the first 10 lines?
Q2. How can I print the every other line?
Also, How does Python define a line? How...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.