GH Python : change value to last list's item not working

Hi

i am trying to replace the last value of the list “x” with a given value ( z) when Y==1

i am not able to get it to work when y==1 , can anyone help ? thanks

GH Python if elif.gh (5.5 KB)