Explain the difference between list cloning and list aliasin

Explain the difference between list cloning and list aliasing. Explain the difference between appending to a list and concatenating lists. After the following code is executed: daysOfWeek = [\"Friday\", \"Tuesday\"] daysOfWeek.append(\"Monday\" * 3) daysOfWeek = daysOfWeek + list (\"Sat\") del daysOfWeek[-2] What are the elements in the list daysOfWeek? Write a function splitAndPrintString that has a single parameter, and uses the split and print methods to output on a separate line each word in the String argument. For example, the following code: aString = \"Hello how are you\" splitAndPrintString(aString) would output the following: Hello how are you When working with files, explain what the open function and close method accomplish.

Solution

1)


When you make alias of data , it means more than one variable points to same data. When we talk about clone it means you are creating copy of same data and two variable points to same data.
By definition it must look as both are same thing so lets see an example
a= [1,2,3,4]
b = a
Now a and b points to same data
Let say you make changes to a
a= [5,2,3,4]

so in case of alias these changes will reflect to b as well and b will also have the new data i.e b=[5,2,3,4]
but in case of clone these changes will not reflect to be and b will still point to old data i.e. b=[1,2,3,4]

 Explain the difference between list cloning and list aliasing. Explain the difference between appending to a list and concatenating lists. After the following

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site