thislist = ["apple", "banana", "cherry"] mylist = thislist.copy() print(mylist)
Here is what the above code is Doing:
1. We create a list called thislist.
2. We create a copy of thislist, and assign it to mylist.
3. We print the value of mylist.
thislist = ["apple", "banana", "cherry"] mylist = thislist.copy() print(mylist)
Here is what the above code is Doing:
1. We create a list called thislist.
2. We create a copy of thislist, and assign it to mylist.
3. We print the value of mylist.