Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Here is one possible way to output the results in a csv file.

import csv

# sample function
f(i,j) = i^2*j

with open('tmp.csv', 'w') as f1:
    writefile = csv.writer(f1)

    for i in range(0,10):
        for j in range(0,10):
            result=[i,j,f(i,j)]
            writefile.writerow(result)