Is there a way I can efficiently read every two lines from input? So, in
data = fileinput.input()
# Now, instead of doing
for line in data:
pass
# I need to do
for (every block of two lines in data):
pass
I am using Python 2.
Is there a way I can efficiently read every two lines from input? So, in
data = fileinput.input()
# Now, instead of doing
for line in data:
pass
# I need to do
for (every block of two lines in data):
pass
I am using Python 2.