If-Else Loops: Python Programming

If-Else Loops: Python Programming

11th Grade

16 Qs

quiz-placeholder

Similar activities

Codehs Practice Test

Codehs Practice Test

9th - 12th Grade

12 Qs

Control Statements in Python

Control Statements in Python

11th Grade

20 Qs

CSP Lists Loops and Traversals

CSP Lists Loops and Traversals

10th - 12th Grade

20 Qs

CS Principles Unit 5 Assessment

CS Principles Unit 5 Assessment

9th - 12th Grade

20 Qs

Unit 5 - For Loops

Unit 5 - For Loops

9th - 12th Grade

20 Qs

Intro to Java Loops

Intro to Java Loops

9th - 12th Grade

15 Qs

Unit 10 Recursion Review

Unit 10 Recursion Review

9th - 12th Grade

20 Qs

Gmetrix Python Session 4 Test

Gmetrix Python Session 4 Test

10th - 12th Grade

15 Qs

If-Else Loops: Python Programming

If-Else Loops: Python Programming

Assessment

Quiz

Computers

11th Grade

Hard

Created by

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

Media Image

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

Media Image

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

Media Image

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

Media Image

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

Media Image

What is the output of the following if statement?

False

True

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?