def remove_lastnot(ol,value,**kwargs):
if('<STR_LIT>' in kwargs):<EOL><INDENT>mode = kwargs["<STR_LIT>"]<EOL><DEDENT>else:<EOL><INDENT>mode = "<STR_LIT>"<EOL><DEDENT>length = ol.__len__()<EOL>if(mode == "<STR_LIT>"):<EOL><INDENT>new = copy.deepcopy(ol)<EOL>for i in range(length-<NUM_LIT:1>,-<NUM_LIT:1>,-<NUM_LIT:1>):<EOL><INDENT>if(new[i] == value):<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>new.pop(i)<EOL>return(new)<EOL><DEDENT><DEDENT>return(new)<EOL><DEDENT>else:<EOL><INDENT>for i in range(length-<NUM_LIT:1>,-<NUM_LIT:1>,-<NUM_LIT:1>):<EOL><INDENT>if(ol[i] == value):<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>ol.pop(i)<EOL>return(ol)<EOL><DEDENT><DEDENT>return(ol)<EOL><DEDENT>
from elist.jprint import pobj
from elist.elist import *
ol = [1,'a',3,'a',5,'a']
id(ol)
new = remove_lastnot(ol,'a')
ol
new
id(ol)
id(new)
####
ol = [1,'a',3,'a',5,'a']
id(ol)
rslt = remove_lastnot(ol,'a',mode="original")
ol
rslt
id(ol)
id(rslt)