Aug-10-2018, 04:34 PM
Hello everyone ,
I need a small help on python.
I have a list like a=[1 2 3 4 5 ]
I need to obtain abother list by summing second and third index and making third index equal to 0 which is
a=[1 5 0 4 5]
So far there is no problem.
The problem when it is needed in the following parts of the code, i must go back to the original list which is a=[1 2 3 4 5];
but since I did a[2]=0 (to make third index equal to zero), I can not go back to original list. I guess I should save the original list somehow but even when I save , when I said make a[2]=0 , saving list also changes .
Can you help me, how can I achieve this task , please ?
how can I turn original list , or call original list when I need ?
Thank you
I need a small help on python.
I have a list like a=[1 2 3 4 5 ]
I need to obtain abother list by summing second and third index and making third index equal to 0 which is
a=[1 5 0 4 5]
So far there is no problem.
The problem when it is needed in the following parts of the code, i must go back to the original list which is a=[1 2 3 4 5];
but since I did a[2]=0 (to make third index equal to zero), I can not go back to original list. I guess I should save the original list somehow but even when I save , when I said make a[2]=0 , saving list also changes .
Can you help me, how can I achieve this task , please ?

Thank you