So I am trying to open a new file, and write in to that file all the values of n
.
for n in [4, 7, 8, 10, 6, 3, 5, 13]:
if n > 5:
print(n)
b = open('new', 'w')
b.write(n)
It writes the numbers in as a string and only writes in 13
, the last n
.