Question: Problem 1 : Write a function named sort _ as _ str that takes three integers and return a string containing the numbers in sorted

Problem 1: Write a function named sort_as_str that takes three integers and return a string containing the numbers in sorted order.
For example: sort_as_str 546 would return "4:5:6"
Problem 2: Write the following functions:
abs a - return the absolute value of a
inc a - returns a +1
dec a - return a 1
double a - returns 2* a
tribple a return a *3
half a return a /2
Print the result for the expression below:
-2|> double |> triple |> inc |> half |> abs |> dec |> dec
Problem 3: Write a recursive function named divide that takes two integers that returns the result of the number by the second number. You can assume that the numbers are positive. The function uses the -(subtraction) operator to recursively compute result. The result is the number of time it takes to decrement the first number by the second number until the first number is less than the second number.
divide 52 would return 2
divide 123 would return 4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!