Here is my task: Write a sign up program for an after school club, it should ask the user for the following details and store them in a file: First Name, Last Name, Gender and Form.
Here is my code so far:
f= open("test.txt","w+")
first_name = input("Enter your First name>>>> ")
last_name = input("Enter your Last name>>>> ")
gender = input("Enter your gender>>>> ")
with open("test.txt", "a") as myfile:
myfile.write(first_name, second_name, gender)
I have created the file but when I try to write to it I get an error saying
myfile.write(first_name, last_name, gender)
TypeError: write() takes exactly 1 argument (3 given)"