I understand the code below works fine. Reading the while loop documentation in Python, they say that while expression should be True or False and that makes sense.
Now the readline()
function returns string. So how this while loop works that way?
with open(datafile, "r") as f:
line = f.readline();
while line :
print line
line = f.readline()
data.append(line)
print line
return data