If-Else Loops: Python Programming

Quiz
•
Computers
•
11th Grade
•
Hard
Piyush Bhagat
Used 83+ 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
15 questions
Kuizi 14 - Web

Quiz
•
10th Grade - University
20 questions
Creating Algorithms through Pseudocodes and Flowcharts

Quiz
•
10th Grade - University
13 questions
KS4 Python While Loops and For Loops

Quiz
•
9th - 11th Grade
15 questions
Intro to Java Loops

Quiz
•
9th - 12th Grade
18 questions
CS1 Unit 8 Review

Quiz
•
9th - 12th Grade
16 questions
Python Looping with Integers

Quiz
•
9th - 12th Grade
20 questions
Control Statements in Python

Quiz
•
11th Grade
20 questions
11.2 Constructs Cambridge iAS 9618

Quiz
•
11th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
40 questions
LSHS Student Handbook Review: Pages 7-9

Quiz
•
11th Grade
20 questions
Scalars, Vectors & Graphs

Quiz
•
11th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
10 questions
Solving Equations Opener

Quiz
•
11th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade