WorksheetsPython IF statements Part 4
Total questions: 20
Worksheet time: 12mins
The "If" Statement is an example of a _________________
Correctional Statement
Competitive Statement
Conditional Statement
Inquisitive Statement
How many "if" statements can a single program have?
<10
<20
<30
As many as is needed
Which of these can be paired with an "if" statement to represent other outcomes of a scenario?
or
else
but
sheboygan
How many "else" statements can you pair with a single "if" statement
1
<10
<20
As many as is needed.
How many "else if" links can you have in an "if/else" chain?
<10
<20
<30
As many as is needed to represent the situation
What are booleans?
What is the output to the python code?
X = 5
Y = 5
print(X == Y)
Which character must be at the end of the line for if?
:
;
.
{
Pieces of code that only run "under certain conditions":
conditional statements
control flow statments
syntax
variables
What is elif in Python?
eliminate if
else if
A person's name
False
What part of an if statement should be indented?
All of it
The statements within it
the first line
the lines within the brackets
If x = 5 and y = 10, evaluate the following:
(x != 5 || y < 10)
True
False
If x = 5 and y = 10, evaluate the following:
!(x > y) && (y != 12)
True
False
If x = 5 and y = 10, evaluate the following:
!((x > y) && (y != 12))
True
False
If x = 5 and y = 10, evaluate the following:
((x == 5) || (y == 9))
True
False
If x = 5 and y = 10, evaluate the following:
((x != 5) || (y == 9))
True
False
If x = 5 and y = 10, evaluate the following:
! (x > 5 || y < 10)
True
False
