If-Else Loops: Python Programming

Quiz
•
Computers
•
11th Grade
•
Hard
Piyush Bhagat
Used 90+ 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
13 questions
Keep It Really Safe Lego SPIKE Prime Lesson Review

Quiz
•
7th Grade - University
15 questions
If dan For dalam Bahasa C

Quiz
•
11th Grade
14 questions
p5.js Week1 PREtest

Quiz
•
7th - 12th Grade
15 questions
Reviewing the lessons after a long holiday

Quiz
•
9th - 12th Grade
11 questions
Python Review

Quiz
•
11th Grade
17 questions
Coding 2 and 4

Quiz
•
7th Grade - University
16 questions
unit 1 BTEC Level 3 Computer Science

Quiz
•
11th - 12th Grade
20 questions
HC-12

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
20 questions
Digital Citizenship

Quiz
•
8th - 12th Grade
35 questions
Computer Baseline Examination 2025-26

Quiz
•
9th - 12th Grade
13 questions
Problem Solving Process

Quiz
•
9th - 12th Grade
10 questions
Understanding Algorithms with Pseudocode and Flowcharts

Interactive video
•
9th - 12th Grade
19 questions
AP CSP Unit 1 Review (code.org)

Quiz
•
10th - 12th Grade