0

How to write a program which fills a text file with numbers from 1-100 among each other?

my code makes the side by side and without empty lines. What am I doing wrong? *\n doesn't work in this case

5th Jun 2017, 3:54 PM
lars
3 Respostas
+ 6
Show the code so people can see what might be wrong with it :)
5th Jun 2017, 4:06 PM
Kuba Siekierzyński
Kuba Siekierzyński - avatar
+ 1
Thank you but I guess I've got it: Dataname = 'E:/Textdoc.txt' List = [] for i in range (0,100): List.append ('%2d \n'% (i) f=open (Dataname,'w') f.writelines (List) f.close ()
5th Jun 2017, 4:11 PM
lars
0
now I want to sum all of these numbers from the textdata and cant find it on google
5th Jun 2017, 4:13 PM
lars