Search Header Logo

Quiz on Flow of Control in Python

Authored by sapna Pradeep

Computers

12th Grade

Quiz on Flow of Control in Python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

41 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary concept of sequence in Python?

Executing statements in random order

Executing statements one after another

Executing statements only when conditions are met

Executing statements based on user input

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which control structure allows for decision making in Python?

Loop

Function

If..else statement

Variable

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code: print(5 - 7)?

0

2

5

-2

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the 'elif' statement do in Python?

Repeats the if statement

Ignores the if statement

Checks another condition if the first is false

Ends the if statement

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of indentation in Python?

To comment out code

To define blocks of code

To create variables

To make the code look good

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a looping construct in Python?

Function

For loop

If statement

Variable assignment

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code: for i in range(3): print(i)?

0 1 2 3

1 2

1 2 3

0 1 2

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?