# open a file for writing file_object = open('security.txt', 'w') # ask user for username username = input("What is your username?") # ask user for password password = input("What is your password?") # write each to the file with linebreaks in between file_object.write(username) file_object.write("\n") file_object.write(password) file_object.write("\n") # close the file when you’re done file_object.close()