Save
SC1003
boolean data type, relational operators, selections
Save
Share
Learn
Content
Leaderboard
Share
Learn
Created by
aiya
Visit profile
Cards (35)
What is a conditional statement?
A statement that performs different actions based on whether a
condition
is true or
false
View source
How does a conditional statement determine which action to take?
It evaluates whether the condition is
true
or
false
View source
What are the two possible values of a Boolean data type?
True
or
False
View source
What are relational operators used for?
To compare
two numbers
Returns a
Boolean
value of either
True
or
False
View source
What does the relational operator "==" signify?
Equal
to
View source
What does the relational operator "!=" signify?
Not equal
to
View source
What does the relational operator "<" signify?
Less than
View source
What does the relational operator "<=" signify?
Less
than or
equal
to
View source
What does the relational operator ">" signify?
Greater than
View source
What does the relational operator ">=" signify?
Greater
than or
equal
to
View source
What is the purpose of program execution and flow control?
To control which
instruction
should be
executed next
View source
What is the default flow of program execution?
Defined by the "
sequence
" concept, executing
instructions
one after another
View source
What is selection (branching) in programming?
When an algorithm makes a choice to do one of
two
or
more
things
View source
What is the most common programming statement used for branching?
IF statement
View source
What does an IF statement do?
Executes a
block
of code if the
conditional
expression is true
View source
What is the structure of an IF statement in pseudocode?
IF conditional
expression is True
THEN
DO
THIS
END
IF
View source
Why is proper indentation important in programming?
It improves code
readability
and indicates the
structure
of the code
View source
What is the designated name for the Boolean data type in Python?
bool
View source
What is a statement in Python?
Each
line
of code in a Python program
Interpreted
and
run
one by one
View source
What does the backslash "\" signify in
Python
?
It is used to continue a
statement
onto the
next line
View source
What is the purpose of comments in Python?
To provide information and improve code
readability
View source
How does Python handle comment lines?
Anything after the pound sign "#" is
ignored
during
interpretation
View source
What is an
interpreter error
in
Python
?
An error that occurs when the
syntax
of the
code
is invalid or malformed
View source
What is the built-in function used to get user input in Python?
input
View source
What does the input function do?
It prints a message and
waits
for the user to
type
something
View source
What does the input function do in
Python
?
It prompts the user for
input
and returns it as a
string.
View source
What happens when a string is converted to a float in Python?
The string
representation
of a number is converted into a
floating-point
number.
View source
What does the print() function do in
Python
?
It displays
messages
and data on the
shell screen.
View source
What is the purpose of whitespace in Python?
Whitespace separates words in a statement and improves code
readability.
View source
What is the purpose of indentation in Python?
It is used for
grouping
statements and improving code
readability.
View source
What is a Boolean expression in
Python
?
A Boolean expression evaluates to either
True
or
False.
View source
What does an IF statement do in Python?
It executes a block of code
if
a specified
condition
is True.
View source
How does the indentation affect the execution of an IF statement in
Python
?
Indentation
defines the
scope
of the block that will execute if the condition is True.
View source
What is the purpose of comments in Python code?
Comments
are
ignored
during interpretation and are used to explain the code.
View source
What are the key terminologies in Python programming discussed in the material?
Boolean: Either
True
or
False.
Statement
: A line of
code.
Comment: Indicated by a “#” and
ignored
during
interpretation.
Whitespace
: Separates words in a
statement.
Indentation
: Leading
whitespace
for grouping and readability.
View source