BLACK FRIDAY SALE – Unlock Up to 25% OFF on All Exam Prep! - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Python Institute PCPP-32-101 Exam - Topic 1 Question 3 Discussion

Posted by Colette on Apr 02, 2023 at 07:38 PM

What is the result of the following code?

What is the result of the following code?

Suggested Answer: B

This statement is true because the code uses the logging module to create a logger object and set its level to logging.INFO. The logging module provides a way of reporting events that occur during the execution of a program. The logging level determines which events are reported and which are ignored. The logging module defines five levels of severity: DEBUG, INFO, WARNING, ERROR, and CRITICAL. The lower the level, the more events are reported.

The code then uses the logger object to log two messages: one with the level logging.DEBUG and one with the level logging.INFO. The logger object only reports the messages that have a level equal or higher than its own level. Therefore, the message with the level logging.DEBUG is ignored, while the message with the level logging.INFO is reported. The default format for reporting messages is ''level name: message''. Therefore, the output of the code is:

INFO: Loading data...


Get Premium PCPP-32-101 Questions as Interactive Web-Based Practice Test or PDF Real Exam Format Detailed Explanations Instant Access Get Your Practice Test
12 comments · newest first
JA
Javier 1 year ago
Not so sure about that, could be nothing at all!
MI
Micah 1 year ago
I agree with D, it makes sense to show both.
AB
Abraham 1 year ago
Wait, how can it display both messages? Sounds weird.
RU
Rutha 1 year ago
Definitely not A, that's for sure!
BU
Buffy 1 year ago
I think it will show "Loading data..."
JE
Jesusita 1 year ago
I remember something about debugging modes, but I can't recall if it was supposed to show both messages together or just one.
NI
Nilsa 1 year ago
I'm not entirely sure, but I feel like "Loading data..." is a common output in these scenarios.
NA
Nana 1 year ago
I practiced a similar question where the output was conditional based on a flag. I wonder if that's the case here too.
TA
Talia 1 year ago
I think the code is supposed to display something, but I can't remember if it shows just one message or both.
AN
Annett 1 year ago
Wait, I'm not sure about this. Isn't a Type II error when we fail to reject the null when it's false? I'm second-guessing myself now. Maybe I should review my notes on hypothesis testing before answering.
JO
Jovita 1 year ago
Okay, let's see. If the table only has school names, I think we need to find a way to link that to the address information. Maybe an alternate name table could work?
TE
Terrilyn 1 year ago
Okay, I think I've got it. The company is trying to encourage existing customers to buy from them again, so the answer must be building brand loyalty.
0/2000 characters

Save Cancel