+ 3
How this is being executed??
a=[1,2,3] a[1,0]=[11,22] 2nd line how works??
2 odpowiedzi
+ 2
The 1 in a[1,0] seems to be for the position, the 0 for number of values to be replaced. So at position 1 numbers 11 and 22 are added. There are no values replaced. Simply test if it is true with a code like this:
a=[1,2,3]
a[0,0]=[11,22]
print(a, "\n")
a=[1,2,3]
a[1,0]=[11,22]
print(a, "\n")
a=[1,2,3]
a[1,1]=[11,22]
print(a, "\n")
a=[1,2,3]
a[1,2]=[11,22]
print(a, "\n")
i didn't look up how it works, I only tested it.
+ 1
Paul
Thank you