Question: ( b ) Write a function sumnum that takes in a formatted string and returns the sum of all the numbers found in that string.

(b) Write a function sumnum that takes in a formatted string and returns the sum of
all the numbers found in that string. (7 points)
#sumnum("I have 2 apples and 30 oranges")=>32
#sumnum("There are no numbers here")=> o
#sumnum("I can have negatives like -2 and -4")=>-6Python Programming
(a) Write a function mur that has the same functionality of map, but uses reduce. (6
points)
 (b) Write a function sumnum that takes in a formatted string

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!