()
| 1 | |
| 2 | |
| 3 | def main(): |
| 4 | input_file = "numbers.txt" |
| 5 | output_file = "numbers-mult.txt" |
| 6 | |
| 7 | output = [] |
| 8 | |
| 9 | with open(input_file, "r") as input_handle: |
| 10 | for line_number, line in enumerate(input_handle, 1): |
| 11 | output.append(line_number * int(line.rstrip())) |
| 12 | |
| 13 | output_handle = open(output_file, "w") |
| 14 | output_handle.write('\n'.join(str(n) for n in output)) |
| 15 | |
| 16 | |
| 17 | if __name__ == "__main__": |