A list of numbers is given: numbers = list(range(10)) The following operation was performed: numbers[:5] = [sum(numbers[:5])] What does the numbers list look like?

Questions & AnswersCategory: PythonA list of numbers is given: numbers = list(range(10)) The following operation was performed: numbers[:5] = [sum(numbers[:5])] What does the numbers list look like?
Lokesh Kumar Staff asked 2 years ago

A list of numbers is given:

numbers = list(range(10))

The following operation was performed:

numbers[:5] = [sum(numbers[:5])]

What does the numbers list look like?
 
a. Unable to make this assignment, a TypeError will be raised.
b. [15, 5, 6, 7, 8, 9]
c. [10]
d. [10, 5, 6, 7, 8, 9]