ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 5 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 28 Apr 2017 My Price 8.00

python language and the Pycharm program

I'm using python language and the Pycharm program. I need help on the following question. The problem is to define a function that will return the rearranged sum as a string. there's four examples given.

 

Susie is learning arithmetic, but she’s not so good at it yet. When the teacher writes down the sum of several numbers together, like 1 + 3 + 2 + 1, Susie has to rearrange the numbers into ascending order before adding them.For example, she would rearrange the previous example to 1 + 1 + 2 + 3 before doing the math.Complete the function math help(problem) that takes a string representing a math problem and rearranges the digits so that Susie can compute the sum. The function will return the rearranged sum as a string.You may assume that only digits 1, 2 and 3 appear in the argument string problem. You may also assume that at least one + symbol appears in problem and that problem is always formatted properly.

Examples:  Function Call :                                                          Return Value

               math_help('3+2+1+1')                                                    '1+1+2+3'

               math_help('1+2+3')                                                        '1+2+3'

               math_help('2+2')                                                             '2+2'

               math_help('1+3+2+3+2+1+3+2+3+1+2')                       '1+1+1+2+2+2+3+3+3+3'

Answers

(11)
Status NEW Posted 28 Apr 2017 06:04 AM My Price 8.00

-----------

Not Rated(0)