madisonsmithren
madisonsmithren madisonsmithren
  • 24-01-2020
  • Computers and Technology
contestada

What is output?
x = 21
if (x > 21):
print (1)
elif (x < 21):
print (2)
else:
print (3)

Respuesta :

Limosa
Limosa Limosa
  • 29-01-2020

Answer:

The output of the following code is 3.

Explanation:

In the following Python Programming Language, the output is 3 because the variable x is equal to 21, then the user check the condition is the variable x is greater than 21 then print it print 1, otherwise the user check that the variable x is less than 21 then print 2, otherwise it print 3. So, the variable x is not greater than 21 or not less than 21, it is equal to 21. That's why the code execute the else block and print 3.

Answer Link

Otras preguntas

PLEASE HELP ME ( HELP NEEDED PLEASE) Find the next three terms. 1,2,4,8,_,_,_,
How to solve real number arithmetic
how many meteor showers does the earth pass through as it orbits the sun?
Pls help I need an answer quick!
What is stepmother in French?
What is the correct way to write sentence 6? Ginsburg worked as a clerk for a U.S District Judge for two years after school as a clerk. Ginsburg then worked as
tell me what you discovered about how changing b with numbers between 0 and 1 changes the graph​
Properties of Gamma rays?Helpppppppp!!!!!​
1 Triangle ABC is similar to triangle DEF with the side lengths of triangle ABC being 5 times the side lengths of triangle DEF. What characteristic of the two t
In the previous election 6,400 people voted. What is the percent decrease in actual voters? A 8.6% B. 11.4% C 12.5% D. 14.3%