Good Night I am left with homework to create a list of books where I can add delete and update the case is that I try it with a cycle for I can only update because when I try to add or delete the only thing that does is to repeat the question I established in the input or in the case when
This is the main one
import libros
#user = usuarios.usuario2
books = libros.ListaLibros
for i in range(0, len(books)) :
pregunta = input('¿Desea agregar,actualizar o eliminar un libro?')
if (pregunta== "agregar") :
book = input("Digite el titulo del libro que desea agregar: ")
books.insert(0, book)
elif (pregunta=="eliminar") :
booksDelete =input("Digite el titulo del libro que desea eliminar: ")
books.remove(booksDelete)
elif (pregunta=="actualizar") :
print(books[i])
else :
print("error")
and this is the one in the books archive
libro1 = "Cocori"
libro2 = "El principito"
libro3 = "Harry Potter"
libro4 = "El señor de los anillos"
libro5 = "Los juegos del hambre"
ListaLibros = [libro1,libro2,libro4,libro5]