Deck 3: Decision Structures and Boolean Logic

ملء الشاشة (f)
exit full mode
سؤال
When using the _____ operator, both subexpressions must be true for the compound expression to be true.

A) or
B) and
C) not
D) maybe
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
In Python the _____ symbol is used as the equality operator.

A) ==
B) =
C) >=
D) <=
سؤال
What is the result of the following Boolean expression, if x equals 5, y equals 3, and z equals 8?
X < y or z > x

A) true
B) false
C) 8
D) 5
سؤال
A Boolean variable can reference one of two values: _____.

A) yes or no
B) true or false
C) T or F
D) Y or N
سؤال
In Python, the _____ symbol is used as the not-equal-to operator.

A) ==
B) <>
C) <=
D) !=
سؤال
The if statement causes one or more statements to execute only when a Boolean expression is true.
سؤال
Which of the following is the correct if clause to determine whether y is in the range 10 through 50?

A) if 10 < y or y > 50
B) if 10 > y and y < 50
C) if y > 10 and y < 50
D) if y > 10 or y < 50
سؤال
Python allows you to compare strings, but it is not case sensitive.
سؤال
What is the result of the following Boolean expression, if x equals 5, y equals 3, and z equals 8?
X < y and z > x

A) true
B) false
C) 8
D) 5
سؤال
When using the _____ operator, one or both subexpressions must be true for the compound expression to be true.

A) Or
B) And
C) Not
D) Maybe
سؤال
What is the result of the following Boolean expression, if x equals 5, y equals 3, and z equals 8?
Not (x < y or z > x) and y < z

A) true
B) false
C) 8
D) 5
سؤال
Python uses the same symbols for the assignment operator and the equality operator.
سؤال
What does the following expression mean?
X <= y

A) x is less than y
B) x is less than or equal to y
C) x is greater than y
D) x is greater than or equal to y
سؤال
A(n) _____ structure is a logical design that controls the order in which a set of statements execute.

A) function
B) control
C) sequence
D) iteration
سؤال
The decision structure that has two possible paths of execution is known as _____.

A) single alternative
B) double alternative
C) dual alternative
D) two alternative
سؤال
The Python language is not sensitive to block structuring of code.
سؤال
Which logical operators perform short-circuit evaluation?

A) or, not
B) not, and
C) or, and
D) and, or, not
سؤال
Multiple Boolean expressions can be combined by using a logical operator to create _____ expressions.

A) sequential
B) logical
C) compound
D) mathematical
سؤال
Nested decision structures are one way to test more than one condition.
سؤال
Which of the following is the correct if clause to use to determine whether choice is other than 10?

A) if choice != 10:
B) if choice != 10
C) if choice <> 10:
D) if choice <> 10
سؤال
Python provides a special version of a decision structure known as the _______________ statement, which makes the logic of the nested decision structure simpler to write.
سؤال
The _______________ statement is used to create a decision structure.
سؤال
Boolean variables are commonly used as _______________ to indicate whether a specific condition exists.
سؤال
In flowcharting, the _______________ symbol is used to represent a Boolean expression.
سؤال
A(n) _______________ expression is made up of two or more Boolean expressions.
سؤال
In a decision structure, the action is _______________ executed because it is performed only when a certain condition is true.
سؤال
Expressions that are tested by the if statement are called Boolean expressions.
سؤال
A(n) _______________ operator determines whether a specific relationship exists between two values.
سؤال
An action in a single alternative decision structure is performed only when the condition is true.
سؤال
The not operator is a unary operator and it must be a compound expression.
سؤال
A(n) _______________ statement will execute one block of statements if its condition is true, or another block if its condition is false.
سؤال
A(n) _______________ decision structure provides only one alternative path of execution.
سؤال
The logical _______________ operator reverses the truth of a Boolean expression.
سؤال
Short-circuit evaluation is performed with the not operator.
سؤال
Decision structures are also known as selection structures.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/35
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 3: Decision Structures and Boolean Logic
1
When using the _____ operator, both subexpressions must be true for the compound expression to be true.

A) or
B) and
C) not
D) maybe
B
2
In Python the _____ symbol is used as the equality operator.

A) ==
B) =
C) >=
D) <=
A
3
What is the result of the following Boolean expression, if x equals 5, y equals 3, and z equals 8?
X < y or z > x

A) true
B) false
C) 8
D) 5
A
4
A Boolean variable can reference one of two values: _____.

A) yes or no
B) true or false
C) T or F
D) Y or N
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
5
In Python, the _____ symbol is used as the not-equal-to operator.

A) ==
B) <>
C) <=
D) !=
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
6
The if statement causes one or more statements to execute only when a Boolean expression is true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
7
Which of the following is the correct if clause to determine whether y is in the range 10 through 50?

A) if 10 < y or y > 50
B) if 10 > y and y < 50
C) if y > 10 and y < 50
D) if y > 10 or y < 50
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
8
Python allows you to compare strings, but it is not case sensitive.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
9
What is the result of the following Boolean expression, if x equals 5, y equals 3, and z equals 8?
X < y and z > x

A) true
B) false
C) 8
D) 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
10
When using the _____ operator, one or both subexpressions must be true for the compound expression to be true.

A) Or
B) And
C) Not
D) Maybe
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
11
What is the result of the following Boolean expression, if x equals 5, y equals 3, and z equals 8?
Not (x < y or z > x) and y < z

A) true
B) false
C) 8
D) 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
12
Python uses the same symbols for the assignment operator and the equality operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
13
What does the following expression mean?
X <= y

A) x is less than y
B) x is less than or equal to y
C) x is greater than y
D) x is greater than or equal to y
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
14
A(n) _____ structure is a logical design that controls the order in which a set of statements execute.

A) function
B) control
C) sequence
D) iteration
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
15
The decision structure that has two possible paths of execution is known as _____.

A) single alternative
B) double alternative
C) dual alternative
D) two alternative
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
16
The Python language is not sensitive to block structuring of code.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
17
Which logical operators perform short-circuit evaluation?

A) or, not
B) not, and
C) or, and
D) and, or, not
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
18
Multiple Boolean expressions can be combined by using a logical operator to create _____ expressions.

A) sequential
B) logical
C) compound
D) mathematical
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
19
Nested decision structures are one way to test more than one condition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
20
Which of the following is the correct if clause to use to determine whether choice is other than 10?

A) if choice != 10:
B) if choice != 10
C) if choice <> 10:
D) if choice <> 10
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
21
Python provides a special version of a decision structure known as the _______________ statement, which makes the logic of the nested decision structure simpler to write.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
22
The _______________ statement is used to create a decision structure.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
23
Boolean variables are commonly used as _______________ to indicate whether a specific condition exists.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
24
In flowcharting, the _______________ symbol is used to represent a Boolean expression.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
25
A(n) _______________ expression is made up of two or more Boolean expressions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
26
In a decision structure, the action is _______________ executed because it is performed only when a certain condition is true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
27
Expressions that are tested by the if statement are called Boolean expressions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
28
A(n) _______________ operator determines whether a specific relationship exists between two values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
29
An action in a single alternative decision structure is performed only when the condition is true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
30
The not operator is a unary operator and it must be a compound expression.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
31
A(n) _______________ statement will execute one block of statements if its condition is true, or another block if its condition is false.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
32
A(n) _______________ decision structure provides only one alternative path of execution.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
33
The logical _______________ operator reverses the truth of a Boolean expression.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
34
Short-circuit evaluation is performed with the not operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
35
Decision structures are also known as selection structures.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 35 في هذه المجموعة.