
Conditional Statements Quiz
Authored by Jyotsna Shastry
others
University
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What keyword would you use to add an alternative condition to an if statement?
else if
elseif
elif
None of the above
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet? x = 10 if x > 5: print("x is greater than 5")
x is greater than 5
x is less than 5
x is equal than 5
No Output
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the given below program? if 1 + 3 == 7: print("Hello") else: print("Know Program")
Hello
Know Program
Complied Successfully ,No Output
Error
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output of the following code snippet? x = 5 if x < 3: print("x is less than 3") elif x == 3: print("x is equal to 3") else: print("x is greater than 3")
x is less than 3
x is equal than 3
x is greater than 3
No Output
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How can you execute multiple statements under a single if block in Python?
Separate statements with a semicolon
Indent the statements to the same level
Use the and keyword between statements
Use the elif keyword
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What signifies the end of a statement block or suite in Python?
A comment
}
A line that is indented less than the previous line
end
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
7.Which one of the following is a valid Python if statement.
f a>=2 :
if (a >= 2)
c) if (a => 22)
if a >= 22
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?