Question: Implement the following functions in the given code: using python repeat() get_int_from_user() get_float_from_user() get_equation_string_for_modulus() I recommend you call your own functions a few times to
Implement the following functions in the given code: using python
repeat() get_int_from_user() get_float_from_user() get_equation_string_for_modulus() I recommend you call your own functions a few times to test them out. Just print() out the result and see if it makes sense. Do not change the parameters. Do not change the names of the parameters and do not change the values of the parameters. Just make use of the values given to you.
Starter code:
# We're going to practice writing functions that manipulate strings. def concatenate(textA, textB): ''' Concatenates strings textA and textB together. ''' return textA + textB def repeat(text, n): ''' Repeats the string text, n times. Expecting n to be an integer. ''' pass def get_int_from_user(question): ''' Uses the given question to ask the user for a number and returns an int. ''' pass def get_float_from_user(question): ''' Uses the given question to ask the user for a number and returns a float. ''' pass # In the function get_equation_string_for_addition() below you can see I have provided three return statements. # Only the first return statement is actually executed. The other two return statements are just examples # of how you can write an equivalent line of code; the second and third return statements will be ignored # because the interpreter will never reach them. def get_equation_string_for_addition(x, y): ''' Returns a string that represents an addition equation. ''' return '{} + {} = {}'.format(x, y, x + y) # return a string that demonstrates an addition equation return '{0} + {1} = {2}'.format(x, y, x + y) # equivalent to previous line return f'{x} + {y} = {x + y}' # equivalent to previous two lines def get_equation_string_for_modulus(x, y): ''' Returns a string that represents a modulus equation. ''' # Use get_equation_string_for_addition() as an example of the text you are meant to produce. # The goal here is to perform a modulus operation and return a string that represents the operation performed. pass Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
