windinthetrees windinthetrees
  • 02-04-2021
  • Computers and Technology
contestada

8. What's the output of this code?
1
def sum(x, y):
return(x+y)
print(sum (sum(1,2), sum(3,4)))

Respuesta :

HonoraryPhd
HonoraryPhd HonoraryPhd
  • 02-04-2021

Answer:

10

Explanation:

[tex]sum(1,2) = 3\\sum(3,4) = 7\\sum(3,7) = 10\\[/tex]

Basically, sum((1+2) + (3+4)) = sum(3,7) = (3+7) = 10

Answer Link

Otras preguntas

Who benefitted from the corrupt bargain?
Which of the following writers did not come from Ireland? a) W. B. Yeats b) James Joyce c) Seamus Heaney d) Oscar Wilde e) none of the above; all came from
why did the framers give the power to congress rather than to the states?
How did professors feelings about black well as a student change over time?
An unbalanced force of 25 N, E, is applied to a 12-kg mass. What is the acceleration given to the mass?
How do you do 720 divided by 10 with the exponet of 3
What are the three branches of government?
Lauren bought 20 ounces of sliced ham. she used 3/4 of the ham to make sandwiches for her friends and 1/5 of the ham in an omelet. how many ounces of ham were l
what creates more friction aluminum foil, wax paper or plastic wrap
A boy jumps into a cold swimming pool and his body temperature goes down. His muscles, blood vessels, and nervous system work together to restore his body tempe