Q. Consider a list:
list1 = [6,7,8,9]
What is the difference between the following operations on list1:


a. list1 * 2

b. list1 *= 2

c. list1 =  list1 * 2


Answer :-

a. list1 will not change it remain same as initial [6,7,8,9].

b. list1 will change it become [6,7,8,9,6,7,8,9]

c. list1 will change it become [6,7,8,9,6,7,8,9]


Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post