Take a look at lists and the difference between pop, remove and del.
Here, for example.
In your case, as Voce wants to remove from the list by value selected, then you must use the remove...
Follow a basic example:
objetos = ["1", "2", "3","4", "5", "6"]
print(objetos)
escolha_cliente = input("ESCOLHA OS ITENS OU DIGITE FIM PARA NAO ESCOLHER NENHUM: ")
escolha_cliente_string = str(escolha_cliente) # Não é necessário fazer o cast para String
print(escolha_cliente_string)
objetos.remove(escolha_cliente_string)
print(objetos)
Remembering that remove will only remove the first found element, that is, if you have more than one, the others will remain in the list.
Also, I made no treatment for the case where the user enters a value that does not exist in the list.
If you have a list of strings, never your condition
escolha_cliente in objetos
will be satisfied, sinceescolha_cliente
will be aint
.– Woss
What should I do in this case? I just replaced it with Slice...
– Samuel Vasconcellos
What do you want to do? If the user type 3, what should be the result?
– Woss
The result should return the list "objects", but without the 3, in this case.
– Samuel Vasconcellos
But which 3? The value 3 or the position 3?
– Woss
Value 3, position 2
– Samuel Vasconcellos