N
N
NoALoser2020-06-16 13:09:13
NoALoser, 2020-06-16 13:09:13
Python, what is the difference between indexing and slicing?
I want to update the list, but I don't understand what is the difference between indexing and slicing: why is 33 in the first version without square brackets, and in the second - with?
a = [1,2,3]
a[0:1] = [33]
a
Ответ: [33,2,3]
и
a = [1,2,3]
a[0] = [33]
a
Ответ:
a[0] returns this same element, that is, a[0]
Similar questions
M
S
M
M
T
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question