Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and beginning April 20th, 2021 (Eastern Time) the Yahoo Answers website will be in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.
Trending News
How to plus a list of numbers which is an input in python?
I have this challenge in Grok Learning where the challenge asks you to take a list of numbers as an input from the user and return the program with the total of all the numbers listed
Example
Input: Enter Number:
User: 10,12,13
Total: 35
I know that you can split up the list using the .split() function but I don't know how to plus all the numbers together.
Help me create the program thank. Here's the screenshot of the challenge
I meant to say thanks

2 Answers
- brilliant_movesLv 76 years agoFavorite Answer
Hi bashu. How about this Python 3 code:
#!/usr/bin/python
#ListAdd.py
#Python 3.4
num_str = input('Enter Numbers: ').split(' ')
total = 0
for n in num_str:
... total += int(n)
print ('Total:', total)
#Note: I've used "... " to indicate a tab character (which Y! Answers removes).
- 6 years ago
Hi Bashu,
Please stop putting our questions online. If you're really stuck, you can send us a question via the 'enquiries' button on the site and we'll give you a hint.