Text Size
Text Size
Exit Full Screen
Python Mini
Show
Source Code
View Source Code in Full Screen
Open in New Tab
def addNum(x, y): newSum = x + y return newSum def calcSum(inputString): subtotal = 0 List = inputString.split(',') for num in List: subtotal = addNum(subtotal, float(num)) return subtotal finalSum = calcSum(raw_input("Please enter a list of numbers, separated by commas.")) print "The sum of your list is %d." % finalSum
ch_SumMyList.py
( around 11 lines python code )
Published By:
EM5700
Published on
2019-10-15T01:25:59Z
Python Mini
- an
OYOclass
application,
own your own class today
.
Run
Result
×
Error message shows here