(Sep-25-2022, 06:05 PM)Calli Wrote: where do I insert this line of code?You should learn to test out code when get solutions.
It's after
results
(you make a set
) line 30 in your code.Both mine and perfringo(a little fancier🎈) code dos the same.
# Make a test set results = {'1.255.255.254', '2.255.255.254', '3.255.255.254'} with open('ip_out.csv', 'w') as fp: print(*results, sep='\n', file=fp) with open('ip_out1.csv', 'w') as fp: for ip in results: fp.write(f'{ip}\n')In files,and Sets dos not have order.
Output:2.255.255.254
3.255.255.254
1.255.255.254