- Joined
- Jun 21, 2011
- Messages
- 4,798
f = open("alice.txt")
x = 0
def if20(file):
z = 0
for line in file:
z += 1
return z
o = if20(f)
print(o)
if o == 20:
for line in f:
print(str.strip(line))
if o != 20:
for line in f:
print(str.strip(line))
x += 1
if x == 20:
input("----- to continue click ENTER -----")
x=0
wtf am I doing wrong the indents are there, the tbg text editor is having a blast.
I need to print lines in blocks of 20, if file only has 20 lines, not ask for ENTER.
x = 0
def if20(file):
z = 0
for line in file:
z += 1
return z
o = if20(f)
print(o)
if o == 20:
for line in f:
print(str.strip(line))
if o != 20:
for line in f:
print(str.strip(line))
x += 1
if x == 20:
input("----- to continue click ENTER -----")
x=0
wtf am I doing wrong the indents are there, the tbg text editor is having a blast.
I need to print lines in blocks of 20, if file only has 20 lines, not ask for ENTER.