My codes are listed as following:
import time
f = open("q1", "r")
g = open("q2", "r")
f1 = (f)
f2 =(g)
for y in f1:
for x in f2:
print(y)
sleep(1)
print(x)
The output does not print line by line,but prints the whole file. How to print both files line by line?
output
1
2
3
4
5
a
b
c
d
e
desired output
1
a
2
b
3
c
4
d
5
e