For questions 2-4, consider the following code:

if (month ==9):
if (day > 15):
print ("Second half of the month")
else:
print ("First half of the month")
else:
print ("Not in September")
What is the output if month = 9 and day = 14?

Respuesta :

Answer:

First half of the month

Explanation:

Given

The above lines of code

Required

Determine the output if month = 9 and day = 14

The first if statement: if (month ==9):  checks if month equals 9.

This statement is true, so the next statement is executed.

The next executable statement:

if (day > 15):

checks if day is greater than 15.

This statement is false, so the else statement is executed

else:

print ("First half of the month")

The above statement is executed and the string "First half of the month" is printed

Answer:

e

Explanation: