title: Python challenge 25: Writing files
body: <p><b>Python Challenge 25</b></p>
  
  <p>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:</p>
  
  <ul>
  <li>First Name</li>
  <li>Last Name</li>
  <li>Gender</li>
  <li>Form</li>
  </ul>
  
  <p>For the above task I wrote the following python code:</p>
  
  <pre><code># Python Challenge 25
  
  print ("Hello user, this is a virtual application form"
         "\nfor joining after-school clubs at -Insert school name here-")
  
  first_name = input("\n\nPlease input your first name:")
  last_name = input("Please input your last name:")
  gender = input("Please input your gender:")
  form = input("Please input your form name:")
  club = input("What after-school club would you like to attend?\n")
  
  file = open("application-form.txt", "w")
  file.write(first_name)
  file.write (last_name)
  file.write (gender) 
  file.write (form)
  file.write (club)
  file.close()
  
  
  print (first_name, "Thank you for taking your time to fill this virtual form"
         "\nall the information has been stored in a file to maintain confidentiality")
  </code></pre>
  
  <p>An example of the outcome of the above code:</p>
  
  <p><a href="https://i.stack.imgur.com/X2k6E.jpg" rel="nofollow"><img src="https://i.stack.imgur.com/X2k6E.jpg" alt="enter image description here"></a></p>
  
  <p><strong>My question</strong></p>
  
  <ol>
  <li><p>When the text file is saved all the user inputs is stored in one line, is there a way where I can put each input on a separate line?</p></li>
  <li><p>Is there a more efficient way to write the above code?</p></li>
  </ol>