List is mutable or not ?
if yes then why
Yes, List is mutable because @Tiago and @anon has answered. i don't have anything to add.😮
List is mutable because they can change "in place". Best to understand with an example: # Strings are immutable x = 'foo' y = x print x # prints foo y += 'bar' print x # prints foo # Lists are mutable x = [1, 2, 3] y = x print x # prints [1, 2, 3] y += [3, 2, 1] print x # prints [1, 2, 3, 3, 2, 1] Notice that in the last example we change y but x also changes!
Mutable because It's not immutable. It can be changed, appended and such.
Yes, lists are mutable because they can be changed. for example: x = [1,2,3,4,5] x.append (6) x.insert (0,0) print(x) Now this would result in x = [0,1,2,3,4,5,6] hence they can be changed. hope that helps...
Why are my users being logged as [object Object] when logging my array/user instead of giving me the values [name, age]?
JS in sololear is latest version or older? What do we use often VAR or LET and CONST?? I Have VAR is no longer used is it true??
Как сравнивать строки в Phyton?
Kotlin get if Var doesn't exist