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

Whose mathematical work on the laws of motion still forms the basis for the study of motion today? A. René Descartes B. Francis Bacon C. Andreas Vesalius D. Isa
Can some one please help me?
In which two regions did the Eisenhower administration effectively use brinkmanship? Korea and Indochina Vietnam and Cuba Russia and Poland France and Germany
Some people prefer interval training because A. they can exercise at a steady, but slow, pace for longer periods of time. B. it's performed with speed and may n
The 1862 battle at Antietam put an end to A. the military career of Stonewall Jackson. B. the Confederate threat to the Union capital. C. the Civil War’s early
Two 100-w light bulbs used a total of 400wh of energy. For how many hours did the light bulbs use power?
Which leader of the Scientific Revolution published On the Revolution of Heavenly Bodies, concluding that the earth revolves around the sun? A. Nicholas Coperni
Supply the missing reason (s) for the given proof
Essay on knowledge is power
Which Asian country defeated Russia in war and gained control of Manchuria and Korea? A. Indochina B. Thailand C. Japan D. Taiwan