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

True or false? The GCF of an odd and even number is always even
describe 59 in two other ways
What is 42/84 in its simplest form?
A line segment has end points of ( 4,-4) and ( 0-5) what are the coordinates of the midpoint of this line segment? a. 2 1/2 , b. -2 -9/2 , c. 4 1/2 , d. 8 ,
Which segment of the American economy declined steadily during the 1980s and 1990s? a. healthcare b. agriculture c. construction d. manufacturing
American foreign policy, according to the text, tends to alternate between a. cold wars and hot wars. b. idealism and realism. c. bipolarism and multilateralism
What is the most appropriate transition to replace the word consequently in the beginning of second sentence? James steered his ship through high winds for thre
why do people create,structure,and change government
What term is used for the division of political authority among branches of government? a. executive privilege b. federalism c. joint chiefs of staff d. sep
Describe a hominid???????