Coding exercise 39
This commit is contained in:
parent
c08bf087c3
commit
a1d394959c
@ -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']))
|
||||
print(addition(['1.2', '2.6', '3.3']))
|
Loading…
Reference in New Issue
Block a user