So i am working on this program to show of what i have learnt as new programmer and also trying to learn new things. I am trying to write this sign up login program but everytime when signing up it overwrites the old sign up.
print ("Ok lets Get Started!")
time.sleep(2)
print ("What would you like your username to be?")
username = input()
#writes there desired username to file
f = open ("USERNAME.txt", 'w')
f.write( username + '\n' )
f.close()
print ("Ok Now what do you want your password to be?")
Pword = input()
#writes desired pasword to file
f = open ("PASSWORD.txt", 'w')
f.write ( Pword + '\n' )
f.close()
So i run this program and enter the details i want.Then it saves it to the text files i have setup and then the program ends.When i then run the program again i enter the details but insted of writing to a new line it overwrites the old one.