title: how to write multiple inputs to text file using append in python?
body: <pre><code>while True:
      def student_info(name,age,gender):
          print("The student name is:",name)
          print("The student age is:",age)
          print("The student gender is:",gender)
      print("*"*70)
      Student_name=input("Enter Student name:")
      Student_age=input("Enter Student age:")
      Student_gender=input("Enter Student gender:")
  
  
      print("*"*70)
  
      with open('Try1.txt', 'w') as f:
        f.write(Student_name+" "+Student_age+" "+Student_gender)
  
  
      student_info(Student_name,Student_age,Student_gender)
  
      print("if you want add more students press 1 ")
      user_input=input("Enter:")
      if user_input=="1":
  
          with open('Try1.txt', 'a') as f:
            f.write(Student_name+" "+Student_age+" "+Student_gender)
          student_info(Student_name,Student_age,Student_gender)
  </code></pre>
  
  <p>I want to add more students to the text, but when I add one more the previous one removes.. I need help in this please.</p>