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 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
Heres a Python function that accomplishes the task of adding even ... View full answer
Get step-by-step solutions from verified subject matter experts
