Home »
Python »
Python List MCQs
What will be the output of the following code? | List Que. 30
30. What will be the output of the following code?
L1=[10,100,1000,10000]
print(L1*2)
- [20, 200, 2000, 20000, 20, 200, 2000, 20000]
- [10, 100, 1000, 10000, 10, 100, 1000, 10000]
- [20, 200, 2000, 20000]
- Error
Answer: B) [10, 100, 1000, 10000, 10, 100, 1000, 10000]
Explanation:
When you multiply the whole list with some integer then it repeats the elements that number of times so here the output will be [10, 100, 1000, 10000, 10, 100, 1000, 10000].