Search Header Logo

Python Quiz - 25/09/2024

Authored by Aayush Tiwari

Computers

University

Used 1+ times

Python Quiz - 25/09/2024
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What will the following code output?

B

A

C

no output

2.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following statements is TRUE about the elif keyword?

It is used to replace multiple if statements.

It must always be followed by an else statement.

It allows checking multiple conditions sequentially.

It terminates the program if the condition is true.

3.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What is the output of the following code?

X is greater

Y is greater

No output

Syntax error

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What is the output of the following code?

0 1 2

1 2 3

infinite loop

3 2 1

5.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which loop will execute at least once, regardless of the condition?

For loop

While loop

Do-while loop

Nested loop

6.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

What is the output of the following code?

0 1 2

0 1 2 3 4

1 2 3

No output

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Which of the following statements is TRUE about loops in Python?

  • The "break" statement skips to the next iteration of the loop.

The "continue" statement exits the loop completely

A "while" loop can be used without a condition

  • The "else" part of a loop is executed only when the loop terminates normally, without a "break".

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?