AP While Loops in Python

AP While Loops in Python

Assessment

Interactive Video

Computers

10th Grade

Practice Problem

Medium

Created by

Mercy Omwoyo

Used 5+ times

FREE Resource

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will the program output if the user enters the number 10?


"Sorry, wrong number!"


"Good job, you guessed it!"


"Try again!"


"Number not found!"

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a while loop?

A loop that runs a specific number of times

A loop that runs as long as a condition is true

A loop that runs indefinitely without a condition

A loop that runs only once

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of a while loop in programming?

To execute a block of code a specific number of times

To execute a block of code only once


To execute a block of code as long as a condition is true


To execute a block of code when a condition is false

4.

MULTIPLE CHOICE QUESTION

30 sec • Ungraded

Are you enjoying the video lesson?

Yes

No

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax for a while loop in Python?


while (condition)

{ ... }


while condition:

... do something ...

while (condition):

... do something ...

while condition

{ ... }

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output of the program when it is executed?


5, 4, 3, 2, 1

5, 4

1, 2, 3, 4, 5


0, 1, 2, 3, 4

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a while loop, what indicates the block of code to be executed?


Parentheses


Indentation


Curly braces

Semicolons

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?