First of all - the course and website are great; I love it!
So, I’m currently doing the Python Function quiz section of the Data Science path.
In the Python Functions quiz we’re asked:
What happens when you call report?
time = "3pm" mood = "good" def report(): print("The current time is " + time) print("The mood is " + mood) print("End of report")
The “correct” answer is given as:
Two Strings are printed:
"The current time is 3pm" and
"The mood is good"
And the tooltip says: " Only the first two print statements are inside the
However, if we call report() and add it over or under print(“End of report”), said print() is still being printed, and the result is:
The current time is 3pm
The mood is good
End of report
This is a case where print() is on the scope of the ENTIRE script, thus - it is always printed.
I also tried this on some python interpreter, which gave me the above string.
So…am I missing something here? Or is the answer incorrect?