Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question: 3 what will be printed when the program below is run? def add…

Question

question: 3
what will be printed when the program below is run?
def add_two(x):
return x + 2
def multiply_by_three(x):
return x * 3
def my_function(x):
return add_two(x) + multiply_by_three(x)
print(my_function(12))
12
24
50
66

Explanation:

Step1: Calculate add_two(12)

$add\_two(12)=12 + 2=14$

Step2: Calculate multiply_by_three(12)

$multiply\_by\_three(12)=12\times3 = 36$

Step3: Calculate my_function(12)

$my\_function(12)=add\_two(12)+multiply\_by\_three(12)=14 + 36=50$

Answer:

50