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
20 questions
Control Statements in Python
Quiz
•
11th Grade
20 questions
Python -Iteration (loops)
Quiz
•
7th - 12th Grade
12 questions
Hour of Code
Quiz
•
6th - 12th Grade
20 questions
Functions, Loops, Arrays, Objects
Quiz
•
9th - 12th Grade
15 questions
CP M4 Repetition & Loops
Quiz
•
9th - 12th Grade
16 questions
Subroutines
Quiz
•
9th - 11th Grade
17 questions
GCSE Computer Science - Python Programming Concepts
Quiz
•
9th - 11th Grade
21 questions
Programming Basics
Quiz
•
9th - 12th Grade
15 questions
Multiplication Facts
Quiz
•
4th Grade
20 questions
Math Review - Grade 6
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
5 questions
capitalization in sentences
Quiz
•
5th - 8th Grade
10 questions
Juneteenth History and Significance
Interactive video
•
5th - 8th Grade
15 questions
Adding and Subtracting Fractions
Quiz
•
5th Grade
10 questions
R2H Day One Internship Expectation Review Guidelines
Quiz
•
Professional Development
12 questions
Dividing Fractions
Quiz
•
6th Grade