Search Header Logo

Coding Adventure III Quiz Part-2

Authored by Tashi Samdrup

Instructional Technology

4th Grade

Used 10+ times

Coding Adventure III Quiz Part-2
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

8 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which type of loop is used when the number of iterations is known?

do-while loop

For the question in English, the correct answer is 'for loop'.

while loop

if-else loop

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between 'while' and 'do-while' loops?

There is no difference between 'while' and 'do-while' loops.

In a 'while' loop, the condition is checked after the loop is executed, while in a 'do-while' loop, the condition is checked before the loop is executed.

In a 'while' loop, the condition is checked before the loop is executed, while in a 'do-while' loop, the condition is checked after the loop is executed at least once.

In a 'while' loop, the loop will always execute at least once, while in a 'do-while' loop, the loop may not execute at all.

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you break out of a loop in coding?

Using the 'break' keyword

Pressing the escape key

By deleting the loop

Using the 'stop' keyword

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an infinite loop and how can it be avoided?

An infinite loop is a loop that only runs once and then stops

An infinite loop is a loop that runs for a very long time and cannot be stopped

An infinite loop is a loop that runs backwards

An infinite loop is a loop that continues to execute indefinitely. It can be avoided by ensuring that the loop condition will eventually become false, or by using control flow statements like break or return to exit the loop.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of using 'continue' statement in a loop?

The purpose of using 'continue' statement in a loop is to end the loop immediately

The purpose of using 'continue' statement in a loop is to skip the current iteration and move to the next iteration without executing the remaining code in the loop for that iteration.

The purpose of using 'continue' statement in a loop is to restart the loop from the beginning

The purpose of using 'continue' statement in a loop is to execute the remaining code in the loop for that iteration

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following loop: for i in range(5): print(i)?

0 1 2 3 4

5 4 3 2 1 0

0 1 2 3 4 5

1 2 3 4 5

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following loop: while x < 5: print(x); x += 1?

7

6

0 1 2 3 4

5

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?

Discover more resources for Instructional Technology