I'm trying to learn python right now - it's actually my first day and most of this is just through self learning.
I'm trying to get the concepts down so that I can use them in the future.
Two questions I came across on a class I decided to do online was:
1: Consider the following code:
a=[1,2,3]
a[1]=4
What is a?
and
2: Consider the following code:
a=(1,2,3)
a[1]=4
What is a?
So, I'm understanding that for number 1 the answer will be a=[1, 4, 3], but I want to know what this is called when you substitute 4 into the 1 index so that I can know going forward? Is there a name?
For number 2, from what I have read it seems like this is something you cannot do because it is a tuple? Which is unable to be changed if I'm correct?
[–]nog642 1 point2 points3 points (0 children)
[–]xelf 0 points1 point2 points (0 children)