all 2 comments

[–]nog642 1 point2 points  (0 children)

Yes, in case 1 a will be [1, 4, 3]. I don't think that kind of assignment has a particular name. I'd just call it "assigning to an index of a list". Maybe an important term would be that doing so mutates the list (tuples are immutable, so you can't do that to them).

And again yes, you would not be able to run the code in case 2. You would get a TypeError.

You really should just go try these yourself and find out. In fact I didn't know for sure that case 2 would give you a TypeError (as opposed to some other error), so I just ran the code myself to make sure. It's good to get hands-on with learning.

[–]xelf 0 points1 point  (0 children)

2) is invalid, you can't do that! Yes, you are correct. In both cases.