Writing files 0 of 9 activities solved
  1. Writing to a file Not yet read
  2. Appending to a file Not yet read
  3. Predict and run Not yet read
  4. Investigate Not yet read
  5. Modify Not yet solved
  6. Modify with the grade on one line Not yet solved
  7. Modify with validation Not yet solved
  8. Make Not yet solved
  9. Make a results file Not yet solved
Next series Sub programs
Writing files

Modify with validation

Sign in to hand in your solution and get feedback.

repeat = True while repeat == True: print("Enter student name") student_name = input() student_name = student_name + "\n" data_file = open("StudentInfo.txt", "a") data_file.write(student_name) data_file.close() print("Enter another student? y/n") choice = input() if choice == "n": repeat = False print("Goodbye!")