The code below just makes it have one letter/number per line then it forms a new line, but I would like to have the numbers on each line and only form a new line everywhere there is a comma.
Is there a way to do this?
Thanks!
def hyp(aFile, bFile):
lista = []
a = open(aFile, "r")
b = open(bFile, "w")
line = a.readline()
for line in a:
words = line.split()
lista.append(words)
value = str(lista)
trunk = map(lambda x: math.sqrt(float(x[0])**2 + float(x[1])**2), lista)
trunk1 = str(trunk)
for answer in trunk1:
b.write("%s\n"%answer)
a.close()
b.close()