1
00:00:07,940 --> 00:00:14,445
Welcome back. Sometimes, you'll want to change an object after you've created it.

2
00:00:14,445 --> 00:00:15,810
You create a list,

3
00:00:15,810 --> 00:00:18,540
I'm going to keep adding items onto the end of the list.

4
00:00:18,540 --> 00:00:22,200
Create a turtle, change it's pen color.

5
00:00:22,200 --> 00:00:26,310
There are two ways to change the value of an object after you've created it.

6
00:00:26,310 --> 00:00:30,255
One, you can make a modified copy of the object.

7
00:00:30,255 --> 00:00:32,775
And the other is to modify the original.

8
00:00:32,775 --> 00:00:35,115
We'll call that mutation,

9
00:00:35,115 --> 00:00:38,100
and it's useful but sometimes confusing.

10
00:00:38,100 --> 00:00:42,875
So today's lesson; How mutation of existing objects works,

11
00:00:42,875 --> 00:00:46,700
recognizing the potential confusion that that can cause.

12
00:00:46,700 --> 00:00:48,410
At the end of today's lesson,

13
00:00:48,410 --> 00:00:53,240
you should be able to identify whether an object is mutable or immutable.

14
00:00:53,240 --> 00:00:56,000
You should be able to identify whether a method mutates

15
00:00:56,000 --> 00:00:58,795
an object or creates a modified copy of it.

16
00:00:58,795 --> 00:01:00,965
And you should be able to recognize when

17
00:01:00,965 --> 00:01:04,625
two different variables are aliases for the same object,

18
00:01:04,625 --> 00:01:08,180
and predict whether an operation on one of those variables is going

19
00:01:08,180 --> 00:01:13,020
to cause an impact on the contents of the other one.