Need help with python homework

Hi everyone! Need help with one python task, I’ve tried to do it several times, but nothing works. If someone knows the solution, pls let me know, I’ll be very grateful!

Program: program asks to enter the file name “school.txt”, reads the names of schools from the file, displays the names of schools with serial numbers on the screen, asks the user which school to add to the file, adds the school name entered by the user to the end of the file without changing the contents of the file.

You can try:

  1. Open the file
  2. Read and save the content in a 2D list
  3. Get the serial numbers in a list and print them
  4. Store the number the user enters in a variable
  5. Check to see if that number is there in the 2D list
  6. If yes, get the serial number and the school name and write it to the file.