Need help with project python? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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.

9th Nov 2017, 6:44 PM
jhandu baam 3 kaaam
jhandu baam 3 kaaam - avatar
1 Answer
+ 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)))
9th Nov 2017, 8:48 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar