Hi guys, i am a beginner with python, (in fact, i started yesterday)
I have some experience with C and CPP. So somethings in python just surprises me(happily, i dont want to say confuses)
#consider there is a file object infile
while 1:
line=infile.readline();
if not line: break
print line
I know that this is a infinite loop which will continously read each line and print it from a file. What surprises me is that how does the readline() function reads the next line every time without any variable for some kind of incrementing. How does it know it should read the line next to the line it read previously.