Select the correct function#
Part 1#
Given the following code block, what happens if you call the report()
function?
time = "{{ params.vars.random_time }} {{ params.vars.am_pm }}"
mood = "{{ params_vars_mood }}"
{{ params.vars.is_defined }}report():
report_time = time
report_mood = mood
{{ params.vars.question_time }}print('The current time is ' + report_time)
{{ params.vars.question_mood }}print('The mood is ' + report_mood)
{{ params.vars.question_end }}print('End of report')
Answer Section#
No Strings are printed
One String is printed: āThe current time is 5 PMā
Two Strings are printed: āThe current time is 5 PMā,āThe mood is mellowā
Three Strings are printed: āThe current time is 5 PMā, āThe mood is mellowā, āEnd of reportā
An error because the function is not defined correctly.
Attribution#
Problem is licensed under the CC-BY-NC-SA 4.0 license.