What is the output of the following loop:-
for l in 'Jhon':
if l == 'o':
pass
print(l, end=", ")
If-Else Loops: Python Programming
Quiz
•
Computers
•
11th Grade
•
Hard
Piyush Bhagat
Used 79+ times
FREE Resource
16 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following loop:-
for l in 'Jhon':
if l == 'o':
pass
print(l, end=", ")
J, h, n,
J, h, o, n,
Error
None of the given Options
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following range() function?
for num in range(2,-5,-1):
print(num, end=", ")
2, 1, 0
2, 1, 0, -1, -2, -3, -4, -5
2, 1, 0, -1, -2, -3, -4
0
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the nested if-else below, what will be the value x when the code is executed successfully.
0
4
2
3
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Given the nested if-else structure below, what will be the value of x after code execution completes.
2
0
3
4
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following nested loop?
10 Chair
10 Table
20 Chair
20 Table
10 Chair
10 Table
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the value of x?
101
None of the given options, this is an infinite loop
99
100
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following if statement?
False
True
15 questions
CP M4 Repetition & Loops
Quiz
•
9th - 12th Grade
13 questions
KS4 Python While Loops and For Loops
Quiz
•
9th - 11th Grade
16 questions
Subroutines
Quiz
•
9th - 11th Grade
17 questions
GCSE Computer Science - Python Programming Concepts
Quiz
•
9th - 11th Grade
20 questions
Python -Iteration (loops)
Quiz
•
7th - 12th Grade
20 questions
11.2 Constructs Cambridge iAS 9618
Quiz
•
11th Grade
15 questions
Kuizi 14 - Web
Quiz
•
10th Grade - University
20 questions
Creating Algorithms through Pseudocodes and Flowcharts
Quiz
•
10th Grade - 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
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Taxes
Quiz
•
9th - 12th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
20 questions
Chapter 3 - Making a Good Impression
Quiz
•
9th - 12th Grade
20 questions
Inequalities Graphing
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University