o .split () it "breaks" the string typed by space that is the default, so the user types 1 2 and m1 gets 1 and m2 gets 2, but they are strings, so use o. map () to do the conversion of these entries to int and .remove () takes a value and removes it from the list if the condition is met. If you still do not understand, check the Python Lists.
lista = [10,20,30]
excluidos = []
m1, m2 = map(int, input().split()) # convertendo os valores digitados para int
for n in lista:
if n > m1 or n < m2:
excluidos.append(n)
lista.remove(n)
print(excluidos)