0
How to input elements in existing list with new variable after code done
8 odpowiedzi
0
# Your code cannot work because python copies only list reference. The solution for that looks like:
import copy
def creat_six_digits(a, value_given):
a = copy.deepcopy(a)
c = a[0].pop();
d = c * value_given
e = d // 5
f = e % 5
a[0] = a[0]+[e]+[f]
#a[0].insert(4, e)
#a[0].insert(5, f)
return a
+ 1
Thanks I will apply it if it use
0
Without using insert() operators
0
a[0] = a[0]+[e]+[f]
0
Can you read and solve
0
I am stuck with....
0
It didn't work, It produce same result as mine code I have send