diff --git a/basics.py b/basics.py index 9547b77..b4579aa 100644 --- a/basics.py +++ b/basics.py @@ -1,4 +1,7 @@ -def nostrings(jumble): - return([number if type(number) == int else 0 for number in jumble]) +def addition(numbers): + total = 0 + for number in numbers: + total = total + float(number) + return total -print(nostrings([99, 'no data', 95, 94, 'no data'])) \ No newline at end of file +print(addition(['1.2', '2.6', '3.3'])) \ No newline at end of file