Execution Flow output

I need help understanding the Correct answer from the “Introduction to Functions” quiz. Please see below for the quiz question that I copied and pasted …

What happens when you call report()?
time = “3pm”
mood = “good”

def report():
print("The current time is " + time)
print("The mood is " + mood)

print(“Beginning of report”)


… The Correct answer is that only Two print statements are produced … “The current time is 3pm” and “The mood is good.” BUT shouldn’t the output include “Beginning of report” as the first of three print statements?!

Please post a link to the exercise (quiz) so we can read it all in context.

Here it is…


Thanks for your help.

1 Like

Alright, now we have it. The question is, ‘what happens when we call, report()?’

Clearly, that does not include the statements already executed beforehand.

Now if they asked, ‘what do we see on the screen?’ our otherwise errant response would be correct.

1 Like

Thank you mtf for clarifying this. I am glad to know my thinking wasn’t totally off here…that ‘what we see on the screen’ will include the print statement that comes before the report() and that print statement will have already been executed beforehand. Thanks!

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.