How can i make a textfile from the input off the user?
f = open('test.txt','w')
date = input("which day is it")
print("" + date)
How can i make a textfile from the input off the user?
f = open('test.txt','w')
date = input("which day is it")
print("" + date)
Use the write()
function.
date = input("which day is it")
with open('test.txt','w') as f:
f.write(date)
with open("text.txt","a") as txt_file:
txt_file.write(input("What is your name?\n"))