Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

( 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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions