""" Example from lecture 8 sept 2025. Write data from a nested listed to file. """ data = [[ 0.75, 0.29619813, -0.29619813, -0.75], [ 0.29619813, 0.11697778, -0.11697778, -0.29619813], [-0.29619813, -0.11697778, 0.11697778, 0.29619813], [-0.75, -0.29619813, 0.29619813, 0.75]] with open('tmp_table.txt', 'w') as outfile: for row in data: for column in row: outfile.write(f'{column:14.8f}') outfile.write('\n')