0

How to input elements in existing list with new variable after code done

https://code.sololearn.com/cy9FXWjoMgMp/?ref=app

22nd Jan 2022, 5:43 PM
Thile Dorje Lama
Thile Dorje Lama - avatar
8 Respuestas
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
22nd Jan 2022, 7:47 PM
JaScript
JaScript - avatar
+ 1
Thanks I will apply it if it use
22nd Jan 2022, 6:02 PM
Thile Dorje Lama
Thile Dorje Lama - avatar
0
Without using insert() operators
22nd Jan 2022, 5:44 PM
Thile Dorje Lama
Thile Dorje Lama - avatar
0
a[0] = a[0]+[e]+[f]
22nd Jan 2022, 6:01 PM
JaScript
JaScript - avatar
22nd Jan 2022, 6:12 PM
Thile Dorje Lama
Thile Dorje Lama - avatar
0
Can you read and solve
22nd Jan 2022, 6:12 PM
Thile Dorje Lama
Thile Dorje Lama - avatar
0
I am stuck with....
22nd Jan 2022, 6:13 PM
Thile Dorje Lama
Thile Dorje Lama - avatar
0
It didn't work, It produce same result as mine code I have send
23rd Jan 2022, 3:14 AM
Thile Dorje Lama
Thile Dorje Lama - avatar