What will be the result of ['a', 'b', 'c'] * 2 in Python?
Correct answer
A. ['a', 'b', 'c', 'a', 'b', 'c']
13 views
A. ['a', 'b', 'c', 'a', 'b', 'c']
13 views
Multiplying a list by an integer duplicates its elements, so ['a', 'b', 'c'] * 2 results in ['a', 'b', 'c', 'a', 'b', 'c'].
Not sure why the answer is A? Ask here and get an explanation.