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: 103 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 29 Apr 2017 My Price 11.00

Part 11: Elementary Arithmetic

I need help with these 2 questions and I can't figure out the codes, I'm given 

for question 2:

def math_help(text):

for question 3: 

def collatz(data):

 

 

Part 11: Elementary Arithmetic (3 points) 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_he lp (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--l+1’) ’ l+l+2+3’
math_help (’ l+2--3’) ’ 1+2+3’
math_help (’ 2+2') ’ 2+2’
math_help (’ l+3+2+3+2+1+3+2+3+l+2’) ’ 1+1+1+2+2+2+2+3+3+3+3’

Attachments:

Answers

(11)
Status NEW Posted 29 Apr 2017 05:04 AM My Price 11.00

-----------

Not Rated(0)