0

So I have this code but I want to add text in a the files can you help me?

def createfile(num):

 with open(f'{name}{num+1}.txt', 'w') as file:
              pass

for num in range(number):
    createfile(num)

print('Alright')
Patrick Haugh
  • 59,226
  • 13
  • 88
  • 96
  • Welcome to stackoverflow. Please check [the documentation](https://docs.python.org/3/tutorial/inputoutput.html#methods-of-file-objects) for file i/o methods, especially `f.write()` and see if you can figure out a solution – G. Anderson Dec 20 '18 at 17:50
  • hi patrick that doesnt work in my code – Ferro Gadhia Dec 20 '18 at 18:55

0 Answers0