Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Python 2.7 - simple function definitions This is a MULTIPLE ANSWER question, whi

ID: 3809961 • Letter: P

Question

Python 2.7 - simple function definitions

This is a MULTIPLE ANSWER question, which means you are able to select one or more answers as being correct. Note that this does not necessarily mean that there are multiple correct answers. In any case, select all the answers you believe are correct.

Which of the following values for age and day would result in a value of "Half price" being assigned to the string variable message when the following Python code is executed?

if age <= 6:
    message = "Free entry"
elif age <= 15 and day[0] == "S":
    message = "Half price"
else:
    message = "Full price"

When age is 14 and day is "Wednesday"

When age is 15 and day is "Monday"

When age is 16 and day is "Sunday"

When age is 7 and day is "Saturday"

When age is 4 and day is "Friday"

When age is 4 and day is "Saturday"

When age is 6 and day is "Sunday"

When age is 14 and day is "Wednesday"

When age is 15 and day is "Monday"

When age is 16 and day is "Sunday"

When age is 7 and day is "Saturday"

When age is 4 and day is "Friday"

When age is 4 and day is "Saturday"

When age is 6 and day is "Sunday"

Explanation / Answer

Answer:

When age is 7 and day is "Saturday"

When age is 4 and day is "Saturday"

When age is 6 and day is "Sunday"

For displaying "Half price" we have to meet the condition like day must be less than or equals to 15 and day first letter should start with 'S'. So above three statements are correct with respect to the condition.