Which keyword is used to perform decision-making in Python?
PROGRAMMING IN PYTHON - UNIT II - TEST 1 MCQS
Quiz
•
Computers
•
University
•
Hard
MS.SHYAMALADEVI C
Used 8+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to perform decision-making in Python?
for
while
if
switch
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
x = 5
if x > 3:
print("Greater than 3")
else:
print("Less than or equal to 3")
Greater than 3
Less than or equal to 3
Invalid syntax
No output
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the purpose of the "else" statement in an "if-else" block?
To execute a block of code if the condition is true
To execute a block of code if the condition is false
To repeat a block of code multiple times
To skip the current iteration of a loop
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which operator is used to combine multiple conditions in a Python if statement?
&&
||
&
|
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which loop executes a block of code a fixed number of times?
for loop
while loop
do-while loop
switch loop
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code snippet?
for i in range(3):
print(i)
0 1 2
1 2 3
3 2 1
2 1 0
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you exit a loop prematurely in Python?
continue
break
return
pass
20 questions
Understanding Functions in Programming
Quiz
•
9th Grade - University
15 questions
Python Basics
Quiz
•
University
10 questions
Workshop 2 Review
Quiz
•
University
15 questions
Python Programming - Introduction
Quiz
•
University
15 questions
Python Basics Quiz 1
Quiz
•
8th Grade - University
15 questions
Python
Quiz
•
University
15 questions
Functions in Python
Quiz
•
University
19 questions
Get started with python
Quiz
•
University
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade