I want to remove an specific element from the list n times, if a put 7 I want to remove all sevens. I'm trying to run this code but get me an error:
elements = [1, 2, 3, 4, 4, 5, 6, 5, 7, 7]
valor = int(input('type a value: '))
for i in range(len(elements)):
if (elements[i] == valor):
elements.remove(valor)
print(elements)
IndexError: list index out of range