Search Header Logo

Loops Quizz

Authored by Robert Daniel

Computers

1st Grade

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

30 sec • 1 pt

What is a 'for' loop used for in programming?

To repeat a block of code a specific number of times

To check a condition and repeat a block of code until the condition is false

To define a function

To print a message to the screen

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a 'while' loop used for in programming?

To repeat a block of code a specific number of times

To check a condition and repeat a block of code until the condition is false

To define a function

To print a message to the screen

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for a 'for' loop in Python?

`for i in range(5):`

`while i < 5:`

`if i < 5:`

`def for_loop():`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax for a 'while' loop in Python?

`for i in range(5):`

`while i < 5:`

`if i < 5:`

`def while_loop():`

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following 'for' loop print? ``` for i in range(3): print(i) ```

0 1 2

1 2 3

0 1 2 3

1 2 3 4

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following 'while' loop print? ``` i = 0 while i < 3: print(i) i += 1 ```

0 1 2

1 2 3

0 1 2 3

1 2 3 4

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In a 'for' loop, what does the `range` function do?

It creates a list of numbers

It checks a condition

It defines a function

It prints a message to the screen

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?