Edit list of entries using Python
Question: My script so far:

    
    
    #DogReg v1.0
    import time
    Students = ['Mary', 'Matthew', 'Mark', 'Lianne' 'Spencer'
                'John', 'Logan', 'Sam', 'Judy', 'Jc', 'Aj'  ]
    
    print("1. Add Student")
    print("2. Delete Student")
    print("3. Edit Student")                             
    print("4. Show All Students")
    useMenu = input("What shall you do? ")
    if(useMenu != "1" and useMenu != "2" and useMenu != "3" and useMenu != "4"):
        print("Invalid request please choose 1, 2, 3, or 4.")
    elif(useMenu == "1"):
        newName = input("What is the students name? ")
        Students.append(newName)
        time.sleep(1)
        print(str(newName) + " added.")
        time.sleep(1)
        print(Students)
    elif(useMenu == "2"):
        remStudent = input("What student would you like to remove? ")
        Students.remove(remStudent)
        time.sleep(1)
        print(str(remStudent) + " has been removed.")
        time.sleep(1)
        print(Students)
    elif(useMenu == "3"):
    

So I'm trying to be able to let the user input a name they want to edit and
change it.

I tried looking up the function for editing list entries and I haven't found
one I'm looking for.


Answer: Suppose the user wants to change `'Mary'` to `'Maria'`:

    
    
    student_old = 'Mary'
    student_new = 'Maria'
    change_index = Students.index(student_old)
    Students[change_index] = student_new
    

Note that you will have to add proper error handling - for example, if the
user asks for modifying `'Xavier'` who is not in your list, you will get a
`ValueError`.

