from random import randint
lista = 10
X = [-1,-2,-3,-4,-5]
R = []
def gravarLista(X):
for i in X:
if i < 0:
R.append(i)
print(R)
for j in R:
if j in X:
X.pop(X.index(j))
print(X)
gravarLista(X)# your code goes here
ZnJvbSByYW5kb20gaW1wb3J0IHJhbmRpbnQKCmxpc3RhID0gMTAKWCA9IFstMSwtMiwtMywtNCwtNV0KUiA9IFtdCgpkZWYgZ3JhdmFyTGlzdGEoWCk6CgogICAgZm9yIGkgaW4gWDoKICAgICAgICBpZiBpIDwgMDoKICAgICAgICAgICAgUi5hcHBlbmQoaSkKICAgIHByaW50KFIpCgogICAgZm9yIGogaW4gUjoKICAgICAgICBpZiBqIGluIFg6CiAgICAgICAgICAgIFgucG9wKFguaW5kZXgoaikpCiAgICBwcmludChYKQoKCmdyYXZhckxpc3RhKFgpIyB5b3VyIGNvZGUgZ29lcyBoZXJl