Computer Science, asked by jayashreevirgo, 11 months ago

>>>L=[1,[2,3],[4,5[6,7]]]
>>>L*2
>>>[L,L]

Answers

Answered by sswaraj04
0

Answer:

You should write question properly

now as question

you have a list

when list is multiplied by a number then all the elements are reproduced that number of times inside same list

so here L * 2 will result to

[ 1,[2,3],[4,5[6,7]], 1,[2,3],[4,5[6,7]]]

Now since you have not assigned it to L means you have not write L = L * 2 so it will just show this output and L will remain the same original one

Now [L,L] will make list of two list i.e

[ [ 1,[2,3],[4,5[6,7]] ] , [ 1,[2,3],[4,5[6,7]] ] ]

Explanation:

Difference between those two operation is first one duplicates element and final list has 3 * 2 = 6 elements while second result in a list which has 2 elements only which are also lists

Hope it helps you :-)

Similar questions