Define a function eventimesodd(a_number_string) that takes a number as a string, adds all the even digits...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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) 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)
Expert Answer:
Answer rating: 100% (QA)
Heres a Python function that accomplishes the task of adding even ... View the full answer
Related Book For
Accounting Information Systems
ISBN: 978-0132552622
12th edition
Authors: Marshall B. Romney, Paul J. Steinbart
Posted Date:
Students also viewed these programming questions
-
A portion of the stockholders' equity section from the balance sheet of Spence Corporation appears as follows. Notice that the company has two classes of preferred stock with different features, in...
-
A 0.5kg ice hockey puck is tied to a 2m long string nailed down to an ice-skating rink (assume frictionless ice). The hockey puck is rotating around in a circular path at the end of the taught string...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
Calculate the following limits at infinity. If necessary, use -inf and inf to denote -co and co. Use DNE if a limit does not exist. 1. lim e = 818 2. lim e = 8178 3. lim In(x) 24x In(x) =
-
A 0.7-kg ball that can slide on a horizontal frictionless surface is attached to a fixed point O by means of an elastic cord of constant nt k = 150 N/m and un-deformed length 600 mm. The ball is...
-
Water is boiling at 1 atm pressure in a stainless steel pan on an electric range. It is observed that 1.25 kg of liquid water evaporates in 30 min. The rate of heat transfer to the water is (a) 1.57...
-
What is the payback period for the project described in Problem 4.21 if the maintenance increases by $\$ 500 /$ year (after the first year)? Data from in problem 4.21 What is the payback period for...
-
Applejack Fine Dining has 970 restaurants across the United States. Maintaining a clean environment for customers is a key success factor at Applejack. Each restaurant is cleaned regularly after...
-
How much money needs to be set aside every year, for the next 7 years, to purchase a new office? The money is expected to earn 8% interest compounded annually and yearly inflation is expected to be...
-
Figure a shows a Houdaille damper, which is a device attached to an engine crankshaft to reduce vibrations. The damper has an inertia Id that is free to rotate within an enclosure filled with viscous...
-
The contractor you have engaged to design your non-profits website has put together a series of incredible, impactful personal narrative videos to illustrate the type of work your group does and the...
-
Northwood Company manufactures basketballs. The company has a ball that sells for $ 2 5 . At present, the ball is manufactured in a small plant that relies heavily on direct labor workers. Thus,...
-
Futura Company purchases the 7 5 , 0 0 0 starters that it installs in its standard line of farm tractors from a supplier for the price of $ 1 3 . 3 0 per unit. Due to a reduction in output, the...
-
Journal entries and trial balanceElite Realty acts as an agent in buying, selling, renting, and managing real estate. The unadjusted trial balance on March 3 1 , 2 0 Y 3 , follows:Elite...
-
Variance Analysis and Standard Costing - Vulcan Rubber SealsVulcan Company produces rubber seals used in the aerospace industry. Standards call for 3 . 5 pounds of material @ $ 3 . 4 0 per pound for...
-
Sanchez Co . sold for $ 1 2 , 0 0 0 inventory that had cost $ 8 , 0 0 0 . Freight terms for the sale were FOB destination and payment terms were 1 / 1 0 , n / 3 0 . Sanchez records sales transactions...
-
Capital budgeting decisions are risky because all of the following are true except : A. Large amounts of money are usually involved B. The investment involves a long-term commitment C. They rarely...
-
Rosalie owns 50% of the outstanding stock of Salmon Corporation. In a qualifying stock redemption, Salmon distributes $80,000 to Rosalie in exchange for one-half of her shares, which have a basis of...
-
Research the information rights management software that may be available for your computer. What are its capabilities for limiting access rights? Write a report of your findings. Optional: If you...
-
Obtain a copy of COBIT (available at www.isaca.org) and read the control objectives that relate to encryption (DS5.8 and DS5.11). What are the essential control procedures that organizations should...
-
Should organizations permit personal use of e-mail systems by employees during working hours?
-
Name three or more branches of Earth science, and describe the focus of each.
-
How does seafloor spreading relate to continental drift?
-
Describe how tectonic plates move in terms of speed and direction.
Study smarter with the SolutionInn App