If-Else Loops: Python Programming

Quiz
•
Computers
•
11th Grade
•
Hard
Piyush Bhagat
Used 92+ 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
Create a free account and access millions of resources
Similar Resources on Wayground
14 questions
1.1.5 CSE Iteration and Loops

Quiz
•
9th - 12th Grade
20 questions
Loops, Lists, Traversals test

Quiz
•
11th Grade
17 questions
CS1 Review Unit 6

Quiz
•
9th - 12th Grade
11 questions
Do Now - Retrieval - Programming and Data Structures

Quiz
•
11th Grade
20 questions
AP CSP Unit 6

Quiz
•
10th - 12th Grade
20 questions
Unit 5 Quiz - Loops & Lists (code.org)

Quiz
•
10th - 12th Grade
18 questions
Computer Science

Quiz
•
9th - 12th Grade
19 questions
Python Loops Review

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade