wei/unit-10/number_writer.py

8 lines
165 B
Python

import json
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
filename = 'numbers.json'
with open(filename, 'w') as f_obj:
json.dump(numbers, f_obj)
print(numbers)