Question: Define a function eventimesodd(a_number_string) that takes a number as a string, adds all the even digits and all the odd digits separately, and then

Define a function eventimesodd(a_number_string) that takes a number as a string, adds

Define a function eventimesodd(a_number_string) that takes a number as a string, adds all the even digits and all the odd digits separately, and then returns the multiplication of the two resulting numbers. Examples: eventimesodd(3246558') returns 260 (ie. (2+4+6+8) x (3+5+5) = 20 x 13) eventimesodd("123456789') returns 500 (ie. (2+4+6+8) x (1+3+5+7+9) = 20 x 25) eventimesodd(777') returns 0 (ie. O x (7+7+7) = 0 x 21)

Step by Step Solution

3.42 Rating (155 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres a Python function that accomplishes the task of adding even ... View full answer

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 Programming Questions!