0
Need help with project python?
how do we multiply values in two columns each in separate text file together? for example 1,2,3 in side a.text file then times those values by these 4,5,6 from side b.text file and printing via loop? thanks in advance ....I NEED SIMPLE BASIC CODE through list and WITHOUT USING ZIP OR FUNCTIONS.
1 ответ
+ 6
You can open both files for reading and read one byte from each of them at a time, while in the loop.
a = open(first_file)
b = open(second_file)
for i in range(3):
print(int(a.read(1))*int(b.read(1)))