43.1k views
3 votes
Read the code below.

What will the computer print if the input for year_variable is 1700?
if year_variable == 1776:
print("Your answer is correct. The Declaration of Independence was signed in “year_variable”.")
elif year_variable 1776: compute_variable = year_variable - 1776
print("Subtract “compute_variable” years from your answer for the correct answer.")

Your answer is incorrect. The Declaration of Independence was signed in 1776.
Subtract 76 years from your answer for the correct answer.
Add compute_variable years to your answer for the correct answer.
Add 76 years to your answer for the correct answer.


PLEASE EXPLAIN HOW YOU GOT IT

2 Answers

3 votes

Answer:

The answer is D.

Step-by-step explanation:

Hope it helps! =D got it on edge

User Spbks
by
5.2k points
5 votes

Answer:

D. Add 76 years to your answer for the correct answer.

Step-by-step explanation:

Write the code in python and make year_variable= 1700

Since the input value is 1700, it is less than 1776. This means the elif year_variable < 1776:

would run. This line of code makes whatever the input value is to be subtracted from 1776, then produce an answer labeled as "compute_variable"

This "compute_variable" is then shown to be in a print function, where it says to add whatever the compute variable is to the input, to get the correct answer.

User Varun Garg
by
5.5k points