Exam PT0-002 All QuestionsBrowse all questions from this exam
Question 272

Given the following script:

Which of the following describes True?

    Correct Answer: C

    True in Python is a Boolean operator. It represents a Boolean value that can either be True or False. In the given script, the condition for the while loop is set to True, which is a boolean value, causing the loop to execute indefinitely. Therefore, True is not a conditional by itself, it is the value used in the condition of the while loop. It is also not an arithmetic operator, which involves mathematical operations like addition, subtraction, etc.

Discussion
DRVisionOption: C

describe true, not the loop

PhillyCheese

while True means loop forever. The while statement takes an expression and executes the loop body while the expression evaluates to (boolean) "true". True always evaluates to boolean "true" and thus executes the loop body indefinitely.

[Removed]Option: C

True and False are boolean operators. A condition would be the entire line "While True:".

PeteyPeteOption: B

B is the right answer and I’ve confirmed it with an expert!

Big_DreOption: A

The keyword True is used as the condition for the while loop.

FasterN8Option: B

'True' is a boolean value, can't be a Boolean Operator, those are well defined as (AND, OR, XOR, etc.). In this case, "True" is also the entirety of the conditional expression that is expected by the while loop. As it so happens, this expression always returns the same value (True).

Etc_Shadow28000Option: C

C. A Boolean operator: True is a Boolean value in Python, which is used in the context of the while loop’s condition. Since True always evaluates to True, this creates an infinite loop. A. A while loop: The while keyword indicates the beginning of a while loop, but it does not describe what True is. B. A conditional: While the while loop contains a conditional statement, True itself is not the conditional but rather the value used in the conditional expression. D. An arithmetic operator: Arithmetic operators include symbols like +, -, *, and /, which are used for mathematical operations. True is not an arithmetic operator.

Cyber_SoterOption: B

While true is a loop, however True is a conditional of that loop. so I think it's B

LiveLaughToasterBathOption: A

The condition in a while loop can be any boolean-valued expression. From hws.edu

LiveLaughToasterBath

free code camp: If the condition evaluates to True..... It's a conditional, I change my answer to B.

AlizadeOption: A

The answer is A. A while loop.

Nelsito

Isn't the "True" keyword itself a boolean operator?

ElDirec

same as you could describe "while true" as a conditional. True is what we are describing, being a boolean, nothing else. Answer C