Python list from input converting to an actual list

9 hours ago 2
ARTICLE AD BOX

I am trying to complete a task where you create an input that takes in an array (eg [1, 2, 3, 4, 5]) and prints the total of the numbers. I have tried the built in sum() function, but since an input defaults to a string it doesn't work, and I also tried converting it to a list using list(), but that also doesn't work. Here is my current code, any help is appreciated:

numbers = list(input("Enter an array of numbers: ")) added = sum(numbers) print(added)
Read Entire Article