FILE_NAME = "file.txt"
FILE_CONTENT = "Hello, and welcome to ",FILE_NAME,"!"
def FILE_WRITER(file_,content):
FILE_OPEN = open(file_,"r+")
FILE_OPEN.truncate(0)
FILE_OPEN.write(''.join(FILE_CONTENT))
FILE_OPEN.close()
return "Fully changed the content of",file_,"to",content,"!"
print(FILE_WRITER(FILE_NAME,FILE_CONTENT))
When I execute the code above, it returns :
('Fully changed the content of', 'file.txt', 'to', ('Hello, and welcome to ', 'file.txt', '!'), '!')
I understand that my variables aren't well named. I tried to search on Google to answer my problem but the only thing I found is that I'm maybe using "tuples" and that I needed to do the transform it to a string