Deck 3: Decision Structures and Boolean Logic

ملء الشاشة (f)
exit full mode
سؤال
Multiple Boolean expressions can be combined by using a logical operator to create __________ expressions.

A) sequential
B) logical
C) compound
D) mathematical
استخدم زر المسافة أو
up arrow
down arrow
لقلب البطاقة.
سؤال
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
سؤال
A Boolean variable can reference one of two values which are

A) yes or no
B) True or False
C) T or F
D) Y or N
سؤال
Which logical operators perform short-circuit evaluation?

A) or, not
B) not, and
C) or, and
D) and, or, not
سؤال
Expressions that are tested by the if statement are called Boolean expressions.
سؤال
When using the __________ logical operator,one or both of the subexpressions must be true for the compound expression to be true.

A) or
B) and
C) not
D) maybe
سؤال
The Python language is not sensitive to block structuring of code.
سؤال
What is the result of the following Boolean expression,given that x = 5,y = 3,and z = 8?
X < y or z > x

A) True
B) False
C) 8
D) 5
سؤال
The not operator is a unary operator which must be used in a compound expression.
سؤال
Decision structures are also known as selection structures.
سؤال
The following statement will check to see if the turtle's pen color is 'green':
if turtle.pencolor()= 'green'
سؤال
Which of the following is the correct if clause to determine whether y is in the range 10 through 50,inclusive?

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 uses the same symbols for the assignment operator as for the equality operator.
سؤال
Short -circuit evaluation is only performed with the not operator.
سؤال
Nested decision statements are one way to test more than one condition.
سؤال
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 if statement causes one or more statements to execute only when a Boolean expression is true.
سؤال
An action in a single alternative decision structure is performed only when the condition is true.
سؤال
The following code snippet will change the turtle's pen size to 4 if it is presently less than 4:
if turtle.pensize()< 4:
turtle.pensize(4)
سؤال
Python allows you to compare strings,but it is not case sensitive.
سؤال
In a decision structure,the action is ___________ executed because it is performed only when a specific condition is true.
سؤال
The turtle.isdown()function returns ___________ if the turtle's pen is down.
سؤال
What is the result of the following Boolean expression,given that x = 5,y = 3,and z = 8?
X < y and z > x

A) True
B) False
C) 8
D) 5
سؤال
The ___________ statement is used to create a decision structure.
سؤال
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 logical __________ operator reverses the truth of a Boolean expression.
سؤال
Which of the following will hide the turtle if it is visible?

A) if turtle.isvisible():
Turtle.invisible()
B) if turtle.isvisible
Turtle.hideturtle()
C) turtle.isvisible():
Turtle.hide()
D) if turtle.isvisible():
Turtle.hideturtle()
سؤال
A(n)__________ statement will execute one block of statements if its condition is true or another block if its condition is false.
سؤال
Which of the following is the correct if clause to determine whether choice is anything other than 10?

A) if choice != 10:
B) if choice != 10
C) if choice <> 10:
D) if not(choice < 10 and choice > 10):
سؤال
In Python the __________ symbol is used as the equality operator.

A) ==
B) <>
C) <=
D) !=
سؤال
In flowcharting,the __________ symbol is used to represent a Boolean expression.
سؤال
A(n)___________ expression is made up of two or more Boolean expressions.
سؤال
A(n)__________ decision structure provides only one alternative path of execution.
سؤال
In Python the __________ symbol is used as the not-equal-to operator.

A) ==
B) <>
C) <=
D) !=
سؤال
Which of the following will determine if the turtle's pen is up and will change it to down if that is the case?

A) if turtle.isup():
Turtle.isdown()
B) if turtle.isdown
Turtle.penup()
C) if not(turtle.isdown()):
Turtle.pendown()
D) if not(turtle.penup())
Turtle.penup()
سؤال
What is the result of the following Boolean expression,given that x = 5,y = 3,and z= 8?
Not (x < y or z > x)and y < z

A) True
B) False
C) 8
D) 5
سؤال
When using the __________ logical operator,both subexpressions must be true for the compound expression to be true.

A) or
B) and
C) not
D) either or or and
سؤال
Boolean variables are commonly used as __________ to indicate whether a specific condition exists.
سؤال
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)__________ operator determines whether a specific relationship exists between two values.
فتح الحزمة
قم بالتسجيل لفتح البطاقات في هذه المجموعة!
Unlock Deck
Unlock Deck
1/40
auto play flashcards
العب
simple tutorial
ملء الشاشة (f)
exit full mode
Deck 3: Decision Structures and Boolean Logic
1
Multiple Boolean expressions can be combined by using a logical operator to create __________ expressions.

A) sequential
B) logical
C) compound
D) mathematical
C
2
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
C
3
A Boolean variable can reference one of two values which are

A) yes or no
B) True or False
C) T or F
D) Y or N
B
4
Which logical operators perform short-circuit evaluation?

A) or, not
B) not, and
C) or, and
D) and, or, not
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
5
Expressions that are tested by the if statement are called Boolean expressions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
6
When using the __________ logical operator,one or both of the subexpressions must be true for the compound expression to be true.

A) or
B) and
C) not
D) maybe
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
7
The Python language is not sensitive to block structuring of code.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
8
What is the result of the following Boolean expression,given that x = 5,y = 3,and z = 8?
X < y or z > x

A) True
B) False
C) 8
D) 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
9
The not operator is a unary operator which must be used in a compound expression.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
10
Decision structures are also known as selection structures.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
11
The following statement will check to see if the turtle's pen color is 'green':
if turtle.pencolor()= 'green'
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
12
Which of the following is the correct if clause to determine whether y is in the range 10 through 50,inclusive?

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:
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
13
Python uses the same symbols for the assignment operator as for the equality operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
14
Short -circuit evaluation is only performed with the not operator.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
15
Nested decision statements are one way to test more than one condition.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
16
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
17
The if statement causes one or more statements to execute only when a Boolean expression is true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
18
An action in a single alternative decision structure is performed only when the condition is true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
19
The following code snippet will change the turtle's pen size to 4 if it is presently less than 4:
if turtle.pensize()< 4:
turtle.pensize(4)
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
20
Python allows you to compare strings,but it is not case sensitive.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
21
In a decision structure,the action is ___________ executed because it is performed only when a specific condition is true.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
22
The turtle.isdown()function returns ___________ if the turtle's pen is down.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
23
What is the result of the following Boolean expression,given that x = 5,y = 3,and z = 8?
X < y and z > x

A) True
B) False
C) 8
D) 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
24
The ___________ statement is used to create a decision structure.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
25
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.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
26
The logical __________ operator reverses the truth of a Boolean expression.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
27
Which of the following will hide the turtle if it is visible?

A) if turtle.isvisible():
Turtle.invisible()
B) if turtle.isvisible
Turtle.hideturtle()
C) turtle.isvisible():
Turtle.hide()
D) if turtle.isvisible():
Turtle.hideturtle()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
28
A(n)__________ statement will execute one block of statements if its condition is true or another block if its condition is false.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
29
Which of the following is the correct if clause to determine whether choice is anything other than 10?

A) if choice != 10:
B) if choice != 10
C) if choice <> 10:
D) if not(choice < 10 and choice > 10):
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
30
In Python the __________ symbol is used as the equality operator.

A) ==
B) <>
C) <=
D) !=
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
31
In flowcharting,the __________ symbol is used to represent a Boolean expression.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
32
A(n)___________ expression is made up of two or more Boolean expressions.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
33
A(n)__________ decision structure provides only one alternative path of execution.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
34
In Python the __________ symbol is used as the not-equal-to operator.

A) ==
B) <>
C) <=
D) !=
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
35
Which of the following will determine if the turtle's pen is up and will change it to down if that is the case?

A) if turtle.isup():
Turtle.isdown()
B) if turtle.isdown
Turtle.penup()
C) if not(turtle.isdown()):
Turtle.pendown()
D) if not(turtle.penup())
Turtle.penup()
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
36
What is the result of the following Boolean expression,given that x = 5,y = 3,and z= 8?
Not (x < y or z > x)and y < z

A) True
B) False
C) 8
D) 5
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
37
When using the __________ logical operator,both subexpressions must be true for the compound expression to be true.

A) or
B) and
C) not
D) either or or and
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
38
Boolean variables are commonly used as __________ to indicate whether a specific condition exists.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
39
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
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
40
A(n)__________ operator determines whether a specific relationship exists between two values.
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.
فتح الحزمة
k this deck
locked card icon
فتح الحزمة
افتح القفل للوصول البطاقات البالغ عددها 40 في هذه المجموعة.