Computer Science
Consider the code below and answer the questions that follow :
def multiply(number1, number2):
answer = number1 * number2
print(number1, 'times', number2, '=', answer)
return(answer)
output = multiply(5, 5)
(i) When the code above is executed, what prints out ?
(ii) What is variable output equal to after the code is executed ?
Related Questions
What is wrong with the following function definition ?
def addEm(x, y, z): return x + y + z print("the answer is", x + y + z)
Write a function namely fun that takes no parameters and always returns None.
Consider the code below and answer the questions that follow :
def multiply(number1, number2): answer = number1 * number2 return(answer) print(number1, 'times', number2, '=', answer) output = multiply(5, 5)
(i) When the code above is executed, what gets printed ?
(ii) What is variable output equal to after the code is executed ?
Find the errors in code given below :
def minus(total, decrement) output = total - decrement print(output) return (output)