If-Else Loops: Python Programming

If-Else Loops: Python Programming

11th Grade

16 Qs

quiz-placeholder

Similar activities

Unit 5 Review

Unit 5 Review

9th - 12th Grade

12 Qs

Unit 6: Loops and Traversals Test

Unit 6: Loops and Traversals Test

10th - 12th Grade

20 Qs

CSP Loops Lists Traversals

CSP Loops Lists Traversals

10th - 12th Grade

20 Qs

APCSA Search & Sort

APCSA Search & Sort

9th - 12th Grade

15 Qs

For and While Loop in Python

For and While Loop in Python

8th - 12th Grade

20 Qs

Karel the Dog Code Quiz

Karel the Dog Code Quiz

9th - 12th Grade

12 Qs

Conditional-Loops

Conditional-Loops

11th Grade

17 Qs

Lesson 5 Looping Quiz

Lesson 5 Looping Quiz

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 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

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?